This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checks if the given object is defined | |
*/ | |
function isdef(o) { | |
if(typeof(o)=="undefined") return false; | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Stores the given key, value pair in localStorage, if it is available | |
*/ | |
function setLocalStorageValue(key, value) { | |
if (window.localStorage) { | |
try { | |
localStorage.setItem(key, value); | |
} catch (e) { | |
// For some reason we couldn't save the value :( | |
console.log("ERROR | Unable to save to localStorage!", key, value, e); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Via @thomasfuchs (http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/) | |
function t(s, d){ | |
for(var p in d) | |
s = s.replace(new RegExp('{'+p+'}','g'), d[p]); | |
return s; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Adds the given parameter to the path | |
export PATH=$PATH:$1 && echo "export PATH=\$PATH:$1" >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Aaron Snoswell http://elucidatedbinary.com | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
NewerOlder