In almost all of the text editors available for React JS adding your own dropdown list is not an easy task. In a React app I was using suneditor, and I needed to add my own dropdown list for the users to select a merge tag from, but I could not find a way from their documentation.
[Read More]
Nodejs Script to Add Rows in CSV File Through Terminal
Filling out a CSV file through Office Excel or LibreOffice Calc is easy enough, but you may find it quicker to type in fields on a terminal, particularly when you want to process the data before entry, use defaults, or keep the entry process totally mouse-free.
[Read More]
What Are the Alternatives to Google Places Geocoding Autocomplete?
After the insane price hike of Google Maps, people are looking for its viable alternatives, including geocoding autocomplete services.
We had Google autocomplete text field in one of the apps, with some 20,000 plus autocompleted sessions a month (Google counts autocomplete by session, not per keystroke).
[Read More]
Google Maps Price Hike, Its Effect on Small and Medium Businesses, and Future Repercussions
Maps, Routes and Places; All Got Out of Developers’ Reach
For a long time, and for no fee, developers and entrepreneurs would freely use Google Maps. In 2018, all of a sudden, Google put a price tag on its Maps services, that included three distinct but related products: Maps, Routes, and Places.
[Read More]
How to Get All Uppercase Words From a String in JavaScript?
And All Lowercase Words, Too
On rare occasions, Google surprises you by returning no useful information for your search. Extracting numbers and retrieving all uppercase words from a given string in JavaScript were two such problems. In the latter case, there were all kinds of regex examples to find capitalized words or uppercase letters, but not the uppercase words.
[Read More]
How to Run Nightmare JS On Remote Linux Server
Nightmare JS is a browser automation tool. It works perfectly on local machine and even has an option to view the browser in action by passing { show: true } option when initializing Nightmare. On remote linux machine, however, it will not work without installing and including an extra package xvfb.
[Read More]
How to Deal With Nightmare JS Zombie Electron Processes
Nightmare JS leaves in its wake zombie electron processes and memory leaks
Nightmare JS is a great browser automation library, especially effective for scrapping websites. It has two faults though: memory leaks and zombie electron processes.
But with a duct-tape hacks we can easily overcome both. For memory leak, which is minor but builds up over time, daily restart of the node script or app is pretty effective and avoids solutions that are overkill.
[Read More]
Restart Pm2 Process Every Day Using A Node Script
A brute force yet effective way to restart scripts that need it
To run NodeJS scripts and apps constantly, we usually use pm2 (some prefer forever). However, some scripts require a brute force restart from time to time as they do not fare better in uninterrupted longer runs. Mostly, the reason is memory leaks of packages you are bound to use but have no control over.
[Read More]
Trace Redirect Urls NPM Request
With NPM request module it is quite easy to observe and trace all the intermediate urls before the final url is reached. We can do that using followRedirect option, which takes either true or false, or a function that should return a boolean value.
[Read More]
Clean Up MongoDB Of Old Inactive Users And Their Data With Node Js Script
Reduce Expensive Database Space By Pruning Never-To-Be-Used-Again Data
Databases are not cheap, especially when your application is just taking off and you are low on budget. It is then that freeing up retrievable and precious space from the database is a good way to save some dollars for a while.
[Read More]
When you purchase through links on techighness.com, I may earn an affiliate commission.