Skip to content

Instantly share code, notes, and snippets.

View rogerlsmith's full-sized avatar

Roger Smith rogerlsmith

View GitHub Profile
@rogerlsmith
rogerlsmith / incrementVersion.js
Created January 23, 2015 04:20
cordova hook for incrementing build number in config.xml (hooks/before_build/incrementVersion.js)
#!/usr/bin/env node
console.log ( 'incrementing version' );
var fs = require ( 'fs' ),
xml2js = require ( 'xml2js' );
var parser = new xml2js.Parser ( );
fs.readFile ( "config.xml", function ( err, data ) {
@rogerlsmith
rogerlsmith / displaylogo
Created November 8, 2011 14:04
Displays an image stored in mysql to a webpage
@rogerlsmith
rogerlsmith / ColorTime.php
Created November 4, 2011 14:57
PHP Code that will convert time to RGB color using HSV
function getColor()
{
$tod = localtime();
$now = $tod[1] + ($tod[2] * 60.0);
$now = $now * (1.0 / (24.0 * 60.0));
$rgb_array = HSV_TO_RGB($now, 0.5, 0.5);
$rgb = dechex($rgb_array['R']) . dechex($rgb_array['G']) . dechex($rgb_array['B']);
return ($rgb);
}