Skip to content

Instantly share code, notes, and snippets.

View rcarver's full-sized avatar
:shipit:
Building Recentralized.

Ryan Carver rcarver

:shipit:
Building Recentralized.
View GitHub Profile
# Set environment variables authorizing AWS for a specific account. Data is stored in:
# ~/.amazon_keys_[account]
# ~/.ec2_[account]/pk-*.pem
# ~/.ec2_[account]/cert-*.pem
# ~/.ec2_[account]/id_rsa-*
function aws {
export AWS_CURRENT=$1
# AWS
if [[ -f "$HOME/.amazon_keys_$1" ]]; then
$(document).ready(function() {
$('form').submit(function() {
var q = $("input#q").val();
$.getJSON("http://en.wikipedia.org/w/api.php?callback=?", {
search: q,
action: "opensearch",
format: "json" },
function(result) {
var suggestions = result[1];
@rcarver
rcarver / Output
Created February 18, 2009 19:36
The difference between CGI.escape and URI.escape
"i" "i.chr" "URI.escape" "CGI.escape"
32 " " "%20" "+"
33 "!" "!" "%21"
36 "$" "$" "%24"
38 "&" "&" "%26"
39 "'" "'" "%27"
40 "(" "(" "%28"
41 ")" ")" "%29"
42 "*" "*" "%2A"
43 "+" "+" "%2B"
git push origin master
ssh ryancarver.com "cd ryancarver.com && git pull origin master"
@rcarver
rcarver / gist:118854
Created May 27, 2009 19:41
Don't do this or Safari will randomly show a blank page and you will be sad
- render " ", :status => 304
+ render "", :status => 304
module Job
extend self
def low(klass, *args)
queue.enqueue(:low, klass, *args)
end
def high(klass, *args)
queue.enqueue(:high, klass, *args)
end
<script type="text/javascript">
// *** EXPERIMENTAL ***
//
// This is an experimental method to be notified when Typekit's fonts have loaded.
//
// It will almost certainly change! Please do not use this on a live site. Please
// do let us know what you think by forking this gist, contacting us at
// support@typekit.com or on Get Satisfaction - http://getsatisfaction.com/typekit
//
@rcarver
rcarver / gist:316032
Created February 26, 2010 19:04
Sample cucumber support for Vanity
Scenario: Choose a free plan, then create an account
When I go to the homepage
And I follow "Register"
Then I should see "Find the plan that's right for you"
When I follow "signup-trial"
Then I fill in "First Name" with "Joe"
And I fill in "Last Name" with "Johnson"
And I fill in "Email" with "joe@joe.com"
And I fill in "Password" with "test"
And I fill in "user[password_confirmation]" with "test"
@rcarver
rcarver / gist:336091
Created March 18, 2010 05:57
what if resque had hooks for job performing?
def perform
if payload_class.respond_to?(:before_perform)
result = args ? payload_class.before_perform(*args) : payload_class.before_perform
return if result == false
end
begin
args ? payload_class.perform(*args) : payload_class.perform
if payload_class.respond_to?(:after_perform)
args ? payload_class.after_perform(*args) : payload_class.after_perform
end
@rcarver
rcarver / Typekit-Font-Events.md
Created May 14, 2010 22:02
Typekit Font Events

Typekit Font Events

UPDATE: Typekit Font Events have been opensourced as WebFont Loader. Typekit's available events will be updated soon with full support for the WebFont Loader API.


Web fonts may be the best thing to happen to web design in years, but that doesn't mean there aren't some tricky issues to overcome. One of the most annoying things is dealing with what's become known as the FOUT or 'Flash of