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 libraries or even learn JavaScript if you are a newbie without using something like jsfiddle. Lets say you want to quickly test some jQuery features you like. Instead of creating a web page with the associated jQuery script tag, you can load jQuery from a CDN into the console directly.
(more…)

Read More

How to automatically backup MySQL database to Dropbox

Ever wanted to backup your MySQL database to Dropbox automatically. Well, there is a nice portable solution with Dropbox Uploader. Dropbox Uploader is a BASH script which can be used to upload, download, delete, list files, move, copy and much more from Dropbox. It’s written in the BASH scripting language and only needs cURL to work. I’ve tested it on my Windows/Cygwin environment at it works like a charm.
(more…)

Read More

Quick way to display CSV files as HTML tables

During database projects I frequently need to export certain views or intermediate results as CSV files. These are further used for importing into other databases. However, many times it is required to display the CSV files in web pages as HTML tables. As most times the data is generated on the fly it requires some JavaScript to turn the CSV data to HTML. One of my current favorite is the csv-to-html-table library. This allows you to easily integrate CSV files into your web pages.
(more…)

Read More

Creating Interactive Charts in AngularJS

Data in the form of rows and columns is boring, and it’s difficult to derive insights from it in that form. Add interactive charts to it, and you make it easier for everybody to make sense of it. You start seeing patterns that were impossible to spot by looking at raw data alone. But how do you add interactive charts to your website?

Well, that’s what this tutorial will teach you. In this post I will walk you through the process of creating interactive charts in one of the most popular JavaScript frameworks – AngularJS. We will be implementing charts via FusionCharts’ JavaScript charts package. And to make our job easier, we will make use of its AngularJS charts plugin.
(more…)

Read More

How to create a mock REST api for testing in nodejs

There is a frequent requirement during api development to create a mock api quickly so that other team members can use the same to test their respective part of the project. For example front-end developers might need the api endpoints to test their designs. Rather than wait for the complete api to be finished, developers can create a mock api quickly for testing. This nodejs module by typicode helps front-end developers who need a quick back-end for prototyping and mocking REST apis!
(more…)

Read More

Cron Expression Parser in PHP

Working with cron scheduling can many times be a frustrating affair. Although setting a few cron jobs at one time can be easy, calculating cron dates in the future in code can get time consuming quickly. The PHP cron expression parser described here can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression or calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.
(more…)

Read More

Building a Cordova mobile app with NetBeans

Here is a quick look at building a mobile app using NetBeans and Cordova. To develop Cordova applications, you must install SDKs for each mobile platform you are targeting. This installation is necessary regardless of whether you do the majority of your work in the SDK or use the CLI for your build cycle. Here we will be focusing on the Android platform, so you will need to install the Android SDK first.

(more…)

Read More

Accessing WordPress data using the new REST api

WordPress is without doubt the most used CMS system around. Various sources peg the usage around 20-30% of all web sites. Whatever the correct figure, there is no doubt that the collective content of WordPress sites is enormously large. However almost all content is virtually held in independent WordPress sites with no way to easily access a sites content programmatically. Of course we have RSS feeds, but it is severely restricted and has a totally different purpose.
(more…)

Read More