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
#!/usr/bin/env bash | |
function printCommitLine(){ | |
local FROM=$1 | |
local TO=$2 | |
if [ TO ]; then | |
git log $GIT_LOG_OPTS --format="$LOG_FORMAT_OPTS" $FROM..$TO | |
else | |
git log $GIT_LOG_OPTS --format="$LOG_FORMAT_OPTS" $FROM | |
fi |
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
/* | |
On Black bookmarklet | |
rondevera.com | |
For quickly getting the On Black URL for a Flickr photo. | |
(On Black: http://bighugelabs.com/onblack.php) | |
Usage: | |
- Create a new item in your bookmark bar with "On Black" as the name, and the | |
code below as the location. |
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
# Add a spacer to the OS X Dock: | |
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; osascript -e 'tell app "Dock" to quit' |
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
// Using jQuery 1.3.2: | |
// Setup: | |
var $foo = $('<div id="foo"></div>').appendTo('body'); | |
$foo; // => [div#foo] | |
$foo.data('bar', 123); | |
$foo.data('bar'); // => 123 | |
// Teardown: | |
$foo.remove(); // => [div#foo] |
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
# Using Globalize2: http://github.com/joshmh/globalize2 | |
# Copy existing attributes from ActiveRecord instance to default translation | |
# proxy instance: | |
SomeClass.all.each do |x| | |
x.globalize_options[:translated_attributes].each do |a| | |
x.send(:"#{a}=", x.read_attribute(a)) | |
end | |
x.save | |
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
# Usage from within a Git repo: | |
# | |
# hubb public/javascripts/app.js | |
# # Opens `https://github.com/<repo>/blob/<branch>/public/javascripts/app.js` | |
# # in your browser. | |
# | |
# hubb | |
# # Opens `https://github.com/<repo>` in your browser. | |
hubb(){ | |
repo=$(git config remote.origin.url | sed "s/^git@github\.com:\(.*\)\.git$/\1/") |
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
<html lang="en"> | |
<head> | |
<style> | |
div { | |
position: relative; | |
display: inline-block; | |
margin: 2em; | |
padding: 5em; | |
background: #fcfcfc; | |
background: -webkit-gradient(linear, left top, left bottom, |
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 Carl = (function(){ | |
var C = {}, | |
drops = []; // private | |
C.eavesdrops = function(pattern){ | |
drops.push(pattern); | |
}; | |
return C; | |
}()); |
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
cdp(){ | |
# For changing directly to a specific project's directory. | |
# Usage: `cdp bloombox` | |
local proj=$1 | |
c "/Users/ron/Documents/Projects/$proj/" | |
settabtitle $proj | |
} | |
_cdp(){ | |
# Tab completion routine for `cdp`: | |
COMPREPLY=() |
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
/* Useful when Campfire chat images are | |
being used more for noise than signal. | |
To use in Propane, add to | |
~/Library/Application Support/Propane/styles/cf_chat.css | |
and restart the app: | |
*/ | |
table.chat tr.message a.loaded img { | |
max-width: 100px !important; |
OlderNewer