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
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
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
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
/** | |
* 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
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
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
// 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
/* 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
#!/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
%pseudo-content-before { | |
position: relative; | |
&:before { | |
content: " "; | |
position: absolute; | |
display: block; | |
} | |
} | |
%pseudo-content-after { |