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
/* | |
Gmail bookmarklet | |
rondevera.com | |
For quickly e-mailing the current page's URL (and the selected text, if any) | |
via Gmail. | |
Usage: | |
- Create a new item in your bookmark bar with the name "Gmail" (or just "Gm", | |
or your favorite Unicode character), 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
/* | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
/* How to select a range of children | |
* (Here, 3rd-7th children, inclusive): | |
*/ | |
ul li:nth-child(n+3):nth-child(-n+7) { | |
outline: 1px solid #0f0; | |
} |
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
<style> | |
body { | |
background: #000; | |
} | |
p { | |
margin: 1em auto; | |
background: -webkit-gradient( | |
linear, left top, left bottom, | |
from(#fff), color-stop(50%, #777), color-stop(50%, #666), to(#111)); | |
background: -webkit-linear-gradient(top, #fff, #777 50%, #666 50%, #111); |
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; | |
}()); |
OlderNewer