Skip to content

Instantly share code, notes, and snippets.

View mavame's full-sized avatar

Matt Van Meter mavame

View GitHub Profile
@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@hagenburger
hagenburger / javascript_loader.js
Created July 30, 2010 15:28
Dynamically load JavaScript files with callback when finished
// Example:
JavaScript.load("/javascripts/something.js");
// With callback (that’s the good thing):
JavaScript.load("http://www.someawesomedomain.com/api.js", function() {
API.use(); // or whatever api.js provides ...
});