PHPnews.io

Overview for 'codediesel'

Visualizing missing data in databases

Written by code-diesel / Original link on Nov. 28, 2019

Missing data in databases can cause bugs in applications or incorrect calculations. Recently, while working on a RETS application, I needed to ensure that not many missing values were encountered in one of the MySQL tables. Although one could easily write a SQL query to find the percentage of missi…



Check PHP syntax from the command line

Written by code-diesel / Original link on Mar. 4, 2019

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’).$ php -l example.phpIf the file contains no syntax errors, the CLI returns the follo…


Middleware in Express applications

Written by code-diesel / Original link on Jan. 15, 2019

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…


Styling terminal string in NodeJS

Written by code-diesel / Original link on Jan. 14, 2019

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.Installation is via npm.npm install chalkUsage is short and si…