PHP command-line interface (CLI) includes a nifty option to quickly check for any syntax errors in a source code file. A simple check for a single file is given below. The option flag to check is -l (lowercase ‘L’).
Read More
Author: sameer

Middleware in Express applications
If you have recently moved or are thinking of moving to the nodejs Express framework than you should primarily get acquainted with its routing and middleware concepts, as an Express application is essentially a series of middleware function calls. Middlewares in Express are functions executed after the incoming request from the client, the middleware then processes the request depending on its purpose and then hands over the request to the next middleware in the chain or generates a output if is the last one in the chain, terminating the request-response cycle.
Read More
Styling terminal string in NodeJS
Most terminal applications or tools in NodeJS are single colored in nature. ‘Chalk’ is a nodejs package that allows you to style your application terminal output strings in various colors and styles, making it more readable and colorful.
Read More
Statistical distribution of column values in MySQL
Many times we need to get a statistical distribution of values in a database table. Say you have a e-commerce shoe store having a product table with the following fields and values. As this is only an example I’ve limited the table to a few items; there will hundreds of rows in a real-life table.
Read More
Updating WordPress GUIDS
Recently I changed domain name of one of my other WordPress blogs. However after transferring I found that the GUId’s of the old posts were not updated. They were still referencing the old domain. This caused the feed of the new site to show incorrect domains. My initial thought was to to use a plugin, but it would have taken some time to search for the one I required. So the next best thing for me was to do a update on the post table directly from my hosting PHPMyAdmin interface.
Read More
How to open various desktop applications from nodejs
The most commonly opened resources in a program are files, urls and database connections. he ‘Opn’ package allows you to open stuff like websites, files, executables in their respective desktop applications. The package is cross-platform.
I usually use the package during testing phase – opening various resources, mostly images and text files after execution of a program.
Read More