Skip to content

Instantly share code, notes, and snippets.

View dannycroft's full-sized avatar

Danny Croft dannycroft

View GitHub Profile
@dannycroft
dannycroft / gist:1509724
Created December 22, 2011 09:45
JavaScript MySQL Date & Time Stamp UTC
function dateTimeStamp(a) {
function b(a) { return 10 > a ? "0" + a : a; }
return a.getUTCFullYear() + "-" + b(a.getUTCMonth() + 1) + "-"
+ b(a.getUTCDate()) + "T"
+ b(a.getUTCHours()) + ":"
+ b(a.getUTCMinutes()) + ":"
+ b(a.getUTCSeconds()) + "Z";
} var d = new Date;
console.log(dateTimeStamp(d));
@dannycroft
dannycroft / solr.textile
Created April 11, 2012 08:22 — forked from kathgironpe/solr.textile
Install Tomcat 6 and Solr on Mac OS X.

SolR and Tomcat

1. Install Tomcat on Mac

Sources: 
http://www.malisphoto.com/tips/tomcatonosx.html

http://wiki.apache.org/solr/SolrTomcat
@dannycroft
dannycroft / gist:2628361
Created May 7, 2012 15:20
Install Homebrew
/usr/bin/ruby -e “$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)”
@dannycroft
dannycroft / gist:2628383
Created May 7, 2012 15:23
Has Homebrew installed
brew -v && brew help
@dannycroft
dannycroft / gist:2628391
Created May 7, 2012 15:24
Install PhantomJS with brew
brew install phantomjs
@dannycroft
dannycroft / gist:2628393
Created May 7, 2012 15:25
Has PhantomJS installed
phantomjs -v && phantomjs -h
@dannycroft
dannycroft / gist:2628419
Created May 7, 2012 15:29
Download CasperJS
git clone git://github.com/n1k0/casperjs.git
@dannycroft
dannycroft / gist:2628427
Created May 7, 2012 15:31
Access CasperJS and checkout the latest version
cd casperjs/ && git checkout tags/0.6.6
@dannycroft
dannycroft / gist:2628431
Created May 7, 2012 15:32
Create a link to the CasperJS source file
ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs
@dannycroft
dannycroft / gist:2628443
Created May 7, 2012 15:33
Check CasperJS has installed
casperjs --version