PHPNews

Switching WordPress to HTTPS

Finally, after much deliberation, I decided to move my blog to https. For the past few months I had encountered articles pointing that google gives a higher ranking for sites served over https. I had decided against https as I was afraid it may slow down by blog. However, the following message from google forced me to …

Continue reading »

Written by code-diesel - - Aggregated on Thursday September 14, 2017


Querying MySQL in Go

Recently I’ve been experimenting with Go, mainly due to its excellent concurrency support. Being a web developer my natural instinct was to integrate it in existing projects – connecting with MySQL was a initial choice. The following is the Go code to connect with MySQL.   package main   import ( "fmt" …

Continue reading »

Written by code-diesel - - Aggregated on Monday June 19, 2017


Scraping Uber ride history data

This month I’ll complete 1 year riding with Uber. The process of booking a ride and the response time has been amazing. This post however is on a different matter. As a data aficionado I was curious on the various locations I had travelled over the year and the cost each month. Heading over to the Uber API docs was a …

Continue reading »

Written by code-diesel - - Aggregated on Tuesday April 11, 2017


Accessing Google Page Insights in PHP

Google Page Insights is a required tool to have when analyzing the speed and usability of your site. As you may know these metrics influence how google ranks your page in search results. If you frequently make changes to your web site designs than it becomes mandatory to check the metrics after each change to make …

Continue reading »

Written by code-diesel - - Aggregated on Tuesday March 21, 2017


Data Quality in web applications

There is nothing painful than having to rebuild a database after you find that the records in the database are corrupted. Data corruption in databases can take many forms – from allowing inaccurate data to be entered to data field truncation due to inadequate field length. This post gives an introduction to the data …

Continue reading »

Written by code-diesel - - Aggregated on Friday March 17, 2017


Handling multiple exceptions in PHP 7.1

Exception handling is one of the ways in which modern languages handle errors. PHP usually handles exception in a separate catch block for each different type of exception. Below is a example exception code that uses three custom exceptions ‘MyFooException’, ‘MyBarException’ and ‘MyBazException’ that is later handled …

Continue reading »

Written by code-diesel - - Aggregated on Tuesday February 14, 2017


New features in PHP 7.1

The PHP development team announced PHP 7.1.0 on 01 Dec 2016. This release is the first point release in the 7.x series. There are a few features – like the void return type – which have been introduced. Below are a few new selected features in PHP 7.1. Void functions A void return type has been added. Functions …

Continue reading »

Written by code-diesel - - Aggregated on Monday February 13, 2017


5 NodeJS MySQL ORMs

ORMs help to abstract data mappings between your code and the database, easing data querying and manipulation. It can also help to easily change the underlying database engine without (mostly) changing any code. The following are a few ORMs you can use with nodejs. Sequelize Sequelize is a promise-based ORM for …

Continue reading »

Written by code-diesel - - Aggregated on Friday February 10, 2017


6 visual regression testing tools for UI design

Responsive layouts are very difficult to test. It is more tedious to design and test all of a project’s screen elements at every breakpoint than it is to code them in the first place. Visual regression allows you to make visual comparisons between the baseline versions of the site and the version in development. The …

Continue reading »

Written by code-diesel - - Aggregated on Friday February 10, 2017


JavaScript console tricks

It is generally easier to quickly experiment with PHP or some other language that has an IDE or REPL. However, it is often tricky to quickly test some new JavaScript code or library without first creating a plain HTML page and dropping down to the console. Chrome developer console however makes it easier to test new …

Continue reading »

Written by code-diesel - - Aggregated on Thursday December 22, 2016