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
## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/ | |
--- | |
- hosts: alpine_install | |
user: root | |
tasks: | |
# - name: create a complete empty file | |
# command: /usr/bin/touch /test/test.conf | |
- name: create a new file with lineinfile |
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
# vagrant.yml | |
- hosts: all | |
user: vagrant | |
sudo: True | |
tasks: | |
- name: Update APT package cache | |
apt: update_cache=yes | |
- name: Upgrade APT packages | |
apt: upgrade=yes |
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
I have marked with a * those which I think are absolutely essential | |
Items for each section are sorted by oldest to newest. Come back soon for more! | |
BASH | |
* In bash, 'ctrl-r' searches your command history as you type | |
- Input from the commandline as if it were a file by replacing | |
'command < file.in' with 'command <<< "some input text"' | |
- '^' is a sed-like operator to replace chars from last command | |
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty. | |
* '!!:n' selects the nth argument of the last command, and '!$' the last arg |
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
{ | |
"caret_style": "phase", | |
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme", | |
"detect_indentation": false, | |
"detect_slow_plugins": false, | |
"folder_exclude_patterns": | |
[ | |
".sass-cache", | |
".git", | |
".hg", |
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
<cfscript> | |
function stripQuotes(str) { | |
var regex = '^"(.+)"$'; | |
var pattern = createObject("java", "java.util.regex.Pattern"); | |
var matcher = pattern.compile(regex).matcher(str); | |
return matcher.replaceAll("$1"); | |
} | |
</cfscript> |
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
SELECT stuff FROM [Product] p | |
JOIN [category] c ON | |
-- collating on the fly #FTW | |
c.[Name] COLLATE SQL_Latin1_General_CP1_CI_AS = p.[Name] COLLATE SQL_Latin1_General_CP1_CI_AS |
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
require 'formula' | |
class YoutubeDl <ScriptFileFormula | |
url 'https://github.com/phihag/youtube-dl/raw/master/youtube-dl' | |
homepage 'http://rg3.github.com/youtube-dl/' | |
md5 'a5b92351e8cfa663c888e7d24116477e' | |
version '2011.08.24-phihag' | |
end |
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
info it worked if it ends with ok | |
verbose cli [ 'node', | |
verbose cli '/Users/muloka/src/npm/cli.js', | |
verbose cli 'install', | |
verbose cli '-g', | |
verbose cli '-f' ] | |
info using npm@1.0.26 | |
info using node@v0.5.5-pre | |
verbose config file /Users/muloka/.npmrc | |
verbose config file /Users/muloka/local/node/etc/npmrc |
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
// saw this on Forrst, forget who posted it though | |
$('[href$="pdf"],.pdf').live("click", function(){ | |
// get the link attribute and find the filename of the PDF | |
var pdfLink = $(this).attr("href"), | |
pdfLocation = pdfLink.substr(pdfLink.lastIndexOf("/")).replace("/",""); | |
_gaq.push(['_trackPageview', pdfLocation]); | |
}); |
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
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g, ''); | |
}; | |
String.prototype.isNumber = function() { | |
return typeof parseFloat(this, 10) === 'number' && isFinite(this) && this.trim().length > 0; | |
}; |