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
# Copies all branches from one git remote to another | |
git push destremote 'refs/remotes/sourceremote/*:refs/heads/*' |
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
cd "`osascript -e 'tell application "Finder"' -e 'set myname to POSIX path of (target of window 1 as alias)' -e 'end tell' 2>/dev/null`" |
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
tell application "Location Helper" | |
set home_address to geocode address "123 Main St., Anytown, US" | |
set location to location of geometry of item 1 of results of home_address | |
set home_coordinates to {lat of location, lng of location} | |
set distance to get distance from coordinates home_coordinates | |
if distance > 500 then |
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
pagination = {} | |
pagination['collection'] = collection.send(:paginate, { | |
:page => context['current_page'], | |
:per_page => @per_page }) | |
pagination['current_page'] = pagination['collection'].current_page | |
pagination['per_page'] = pagination['collection'].per_page | |
pagination['total_entries'] = pagination['collection'].total_entries | |
pagination['next_page'] = pagination['collection'].next_page | |
pagination['previous_page'] = pagination['collection'].previous_page |
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
typeset -ga precmd_functions | |
precmd_functions+='update_git_branch_prompt' | |
update_git_branch_prompt() { | |
RPROMPT=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\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
let s:save_cpo = &cpo | |
set cpo&vim | |
set listchars=eol:\|,trail:_,tab:>- | |
colors peachpuff | |
set printoptions=paper:letter | |
set guifont=Inconsolata:h14 | |
set columns=198 |
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
typeset -ga precmd_functions | |
precmd_functions+='update_git_branch_prompt' | |
update_git_branch_prompt() { | |
RPROMPT=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\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
class ApplicationController < ActionController::Base | |
around_filter :check_for_prefers_recent | |
protected | |
def check_for_prefers_recent | |
if current_user && current_user.show_recent_only? | |
Gift.scope_to_recent do | |
yield | |
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
$(function() { | |
$('#select_all_check').click(function(){ | |
$('input:checkbox').attr('checked', $(this).attr('checked')); | |
}); | |
}); |