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
// Convert to jQuery please... | |
var field = $('password_confirmation_field'); | |
field.hide(); | |
$('user_password').observe('focus', field.show.bind(field)); | |
// This the best? | |
var confirmation = $('#password_confirmation_field').hide(); | |
$('#user_password').focus(function () { | |
confirmation.show(); | |
}); |
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
// Examples: | |
// | |
// HTML: | |
// <form action='messages/1/mark_unread'><input type='submit' class='button_to_link' value='Mark Unread'/></form> | |
// | |
// Rails: | |
// button_to "Mark as unread", mark_as_unread_message_path(message), :method => :put, :class => "button_to_link" | |
// | |
// jQuery: | |
// $(document).ready(function() { |
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
#!/bin/sh -x | |
# hack | |
CURRENT=`git branch | grep "\*" | awk "{print $2}"` | |
git checkout master | |
git pull origin master | |
git checkout ${CURRENT} | |
git rebase master |
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
alias ssp="hack && rake && ship" |
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
#!/bin/sh -x | |
# git name-rev is fail | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
git checkout master | |
git pull origin master | |
git checkout ${CURRENT} | |
git rebase master |
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
#!/bin/sh -x | |
# git name-rev is fail | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
git checkout master | |
git merge ${CURRENT} | |
git push origin master | |
git checkout ${CURRENT} |
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 ruby | |
require 'net/http' | |
require 'optparse' | |
require 'timeout' | |
require 'cgi' | |
class Hash | |
def to_query_string | |
map { |k, v| |
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
class Organization | |
def inspect | |
"An Organization for #@param" | |
end | |
def initialize(param) | |
@param = param | |
end | |
def self.find(param) |
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 'rubygems' | |
require 'activesupport' | |
require 'httparty' | |
module Vimeo | |
# Wrapper around the Vimeo REST service for a user. | |
# Usage: | |
# Vimeo::User.new('brad').clips.each{ |clip| p clip.embed } | |
# | |
class User |
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
module ::ActionController | |
class Base | |
def self.inherited_with_facebooker(subclass) | |
inherited_without_facebooker(subclass) | |
if subclass.to_s == "ApplicationController" | |
subclass.send(:include,Facebooker::Rails::Controller) | |
subclass.helper Facebooker::Rails::Helpers | |
end | |
end | |
class << self |
OlderNewer