Simple clock using standard Javascript

Ah the challenge for making your first clock in Javascript, I remember those days. It seems like such a daunting task at first, but it’s really quite simple....

Read More

Detecting mobile devices with Javascript

Today at work we were struggling with a way to detect the iPad and similar devices without relying on the browser user agent string. We ended up checking the value of window.onorientationchange like so: function is_mobile_device() { if (typeof window.onorientationchange != "undefined") { return true; } else { return...

Read More

Export data as a CSV with PHP

Export data as a CSV with PHP

This is a very simple class for constructing basic comma-separated value (CSV) files in PHP. The export method forces the correct headers to initiate a file download. More information can be had in the PHP documentation. ...

Read More

JSON-RPC 2.0 Implementation

Here’s another quick braindump post. A custom JSON-RPC library I wrote for a project at my last job. It should follow the JSON-RPC 2.0 Spec pretty closely. It does require the jQuery library as well. You can pretty much ignore the MIKU references. Basically it’s just a way of namespacing objects to make them globally available. Try reading up on the YUI library for more...

Read More

Writing a custom Wordpress multi-instance widget

Writing a custom Wordpress multi-instance widget

While working on a soon-to-be finished Wordpress theme for a client, I ran into a situation where it would be useful to create a custom widget that they could use to organize content on their site. Basically, they wanted to be able to select a random post or page and display some associated meta data. Essentially a custom image and content teaser. They were going to be doing this several times...

Read More

Create and list new tickets through the Assembla API

A while back I created a PHP library for interacting with the Assembla Ticket API. I thought it might be useful to someone, so here it is. You can use this library to create and list tickets that exist for one of your Assembla spaces. It’s useful for integrating bug reporting and other feedback features into an application that you may be developing. This code is very much a work in...

Read More