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
function current_git_branch { | |
git branch 2> /dev/null | grep '\*' | awk '{print $2}' | |
} | |
hack() | |
{ | |
CURRENT=$(current_git_branch) | |
git checkout master | |
git pull 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
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
* This is the Parser 2 API version of the LetMeGoogleThatForYou * | |
* Ubiquity script compatible with Ubiquity 0.5+. * | |
* The Legacy parser version is available at * | |
* http://gist.github.com/45201 * | |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
var icon = "http://letmegooglethatforyou.com/favicon.ico"; | |
var tu_desc = "<a href=\"http://www.tinyurl.com\">TinyUrl</a>"; | |
var lmg_desc = "<a href=\"http://lmgtfy.com\">Let Me Google That For You</a>"; |
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
def do_something | |
action = case | |
when self.play?: true ? 'play football' : 'do nothing' | |
when self.work?: 'go to work' | |
when self.sleep?: 'sleep' | |
else: 'What?' | |
end | |
return action | |
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
def update_main_artist | |
artist = rovi_artist ? Artist.find_or_create_by_name rovi_artist.name : artists.first | |
update_attribute :main_artist_id, artist.id | |
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
Dear friends, we are truly sorry. You're right. We live in a bubble | |
and have a lot to learn. We need to do some soul searching and | |
practice mindfulness going forward. We hope that, in time, you'll | |
forgive us. Ladies. |
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> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.0.0"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.csv.js?2.0.0"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?2.0.0"></script> | |
<style type="text/css"> | |
body { | |
font: 10px sans-serif; |
OlderNewer