Skip to content

Instantly share code, notes, and snippets.

function isEven(num) {
return (num & 1) === 0;
}
@evansdiy
evansdiy / guid.js
Created December 11, 2012 07:44
Generate fake GUID(also known as UUID) by using javascript
// original from http://guid.us/GUID/JavaScript
function S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
function generateGuid() {
return (S4() + S4() + "-" + S4() + "-4" + S4().substr(0,3) + "-" + S4() + "-" + S4() + S4() + S4()).toLowerCase();
}
@evansdiy
evansdiy / gist:4239073
Created December 8, 2012 07:12
make a symlink to subl for OSX to using sublime text
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl