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/bash -ex | |
# Paste this into ssh | |
# curl -sL https://gist.github.com/gists/2913223/download | tar -xzO | /bin/bash -ex | |
# When forking, you can get the URL from the download button. | |
pushd $HOME | |
aptget='sudo apt-get' | |
chsh='sudo chsh' |
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
/* Flatten das boostrap */ | |
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid { | |
-moz-box-shadow: none !important; | |
-webkit-box-shadow: none !important; | |
box-shadow: none !important; | |
-webkit-border-radius: 0px !important; | |
-moz-border-radius: 0px !important; | |
border-radius: 0px !important; | |
border-collapse: collapse !important; | |
background-image: none !important; |
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
// Taken from: | |
// http://stackoverflow.com/questions/263965/how-can-i-convert-a-string-to-boolean-in-javascript | |
stringToBoolean = function(string) { | |
switch(string.toLowerCase()){ | |
case "true": case "yes": case "1": return true; | |
case "false": case "no": case "0": case null: return false; | |
default: return Boolean(string); | |
} | |
} |
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
// Taken from: | |
// http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery | |
getURLParameter = function(paramName) { | |
return decodeURIComponent((new RegExp('[?|&]' + paramName + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null; | |
}; |
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
getCookie = function(cookieName) { | |
var r = document.cookie.match("\\b" + cookieName + "=([^;]*)\\b"); | |
return r ? r[1] : undefined; | |
}; |
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
def send_mail(sender='', recipients='', subject='', body='', server='localhost', port=25, username='', password=''): | |
if len(sender) == 0: | |
return { | |
'error': True, | |
'message': "Missing sender email address" | |
} | |
if len(recipients) == 0: | |
return { | |
'error': 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
/** | |
* Remove value(s) from an array | |
* | |
* @return {array} Modified array | |
*/ | |
if (typeof Array.prototype.remove == 'undefined' | |
|| typeof Array.prototype.remove == null) { | |
Array.prototype.remove = function() { | |
var what, a = arguments, L = a.length, ax; | |
while (L && this.length) { |
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
var MODULE = (function (ns, undefined) { | |
ns.publicVariable = 'My module public variable'; | |
privateVariable = 'My module private variable'; | |
ns.publicMethod = function () { | |
console.log(privateVariable); | |
}; | |
privateMethod = function () { |
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
function zeroPad(input, length, character){ | |
var padding = length + 1 - input.length; | |
return (padding > 0 ? Array(length + 1 - input.length).join(character || '0') + input : input); | |
}; |
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
/* Taken from http://robertnyman.com/2010/01/11/css-background-transparency-without-affecting-child-elements-through-rgba-and-filters/ */ | |
.alpha60 { | |
/* Fallback for web browsers that doesn't support RGBa */ | |
background: rgb(0, 0, 0); | |
/* RGBa with 0.6 opacity */ | |
background: rgba(0, 0, 0, 0.6); | |
/* For IE 5.5 - 7*/ | |
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); | |
/* For IE 8*/ | |
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; |