code

todoslist.com progress update

Monday, May 6, 2013
By Colin

application cache and local cache now work on mobile devices, so you can use the site when offline (in an airplane or in the subway, for example) and when you come back online, it will sync to the cloud (if you are signed in). »

todoslist.com progress update

Wednesday, December 26, 2012
By Colin

minified all JS in production (makes the site load faster) eliminated data transfer (most of it) when sending user operations to server (makes using todoslist.com much faster) »

aboutmydevice.com : a new site that helps explore a mobile browser’s Javascript properties

Wednesday, September 7, 2011
By Colin
aboutmydevice.com : a new site that helps explore a mobile browser’s Javascript properties

Here’s the latest website I’m releasing onto the world: aboutmydevice.com. I wrote  it so that I could explore what Javascript properties, objects, and values exist on the browsers of various mobile devices. I walk into a store, go to a phone, load up aboutmydevice.com, and see what kind of... »

My cousin Graham, living on the bleeding edge of chicken wing consumption tracking technology

Monday, February 28, 2011
By Colin

http://grahamc.com/blog/how-to-create-a-super-nerdy-superbowl-that-everyone-will-love/   a rather impressive demonstration of skills »

Perl script make MySQL query, binds variables, outputs JSON

Friday, July 16, 2010
By Colin

An example of a Perl script that is called by an ajax request. The script takes in just one parameter, opens a MySQL DB connection, binds the parameter to the query, and sends the query. The result is then formatted into JSON and returned to the browser. This can be seen in action... »

Perl script makes MySQL query; outputs to JSON

Sunday, June 20, 2010
By Colin

An example of a perl script that is called by an ajax request. The script takes in a few parameters, opens a mySQL DB connection, and then makes a rather tortuous query. The result is then formatted in to JSON and returned to the browser. »

UNIX/AWK Tricks: How to copy a long list of files into a directory

Sunday, April 25, 2010
By Colin

Make your list of files, with complete paths, call it “imgList.txt”. Put every file on a new line. Write a small awk script with the following 1 line: { printf(”cp %s images/\n”,$0);} Save the script as “copyList.awk” Do the following command: awk -f copyList.awk imgList.txt | sh Brief explanation of the awk script: %s means you’re putting a string in that... »

HTML Character Entities in Javascript

Sunday, April 25, 2010
By Colin

Sometimes you need to write html character entities in javascript, but html character entities can’t be used, because they don’t get interpreted by javascript. In javascript, you need to use the equivalent unicode character codes instead. HTML character entity, wrong: formElement.value = "Dirección"; You get: Dirección Unicode character code, correct: formElement.value = "Direcci\u00F3n"; You get: Dirección Unicode character charts are located... »

Handy MySQL Commands

Sunday, April 25, 2010
By Colin

To reset an auto_increment field to 1: ALTER TABLE tbl_name AUTO_INCREMENT = 1; To load a local csv file into an empty existing table: LOAD DATA LOCAL INFILE ‘/completePathToLocalData.csv’ INTO TABLE tableName FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘\n’ IGNORE 1 LINES; This assumes you’ve already created your empty table with the same number... »

jQuery parsererror: clean up your JSON objects

Sunday, March 7, 2010
By Colin

Has your JSON using jQuery web app suddenly stopped working?  Getting a parsererror on your JSON objects, where you got none before?  This is what happened to me when my site upgraded to jQuery 1.4. I use the Google API’s jQuery, and it automatically upgraded my whole site to jQuery 1.4.   In jQuery 1.4,... »