Skip to content

Instantly share code, notes, and snippets.

View jefffederman's full-sized avatar

Jeff Federman jefffederman

View GitHub Profile
@jefffederman
jefffederman / Git - file diff's between two branches
Created October 28, 2010 21:58
List files that have changes between two Git branches
git diff --name-status {branch-1}..{branch-2}
e.g., git diff --name-status master..my_new_branch
@jefffederman
jefffederman / gist:732636
Created December 7, 2010 23:30
Animating PNG's in IE
- wrap img tags in div tag
- animate the divs
- use unitpngfix.js
should be good to go!
@jefffederman
jefffederman / Standard Font Size Progression
Created January 29, 2011 17:53
Standard Font Size Progression
6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 21, 24, 36, 48, 60, 72
@jefffederman
jefffederman / gist:902235
Created April 4, 2011 19:23
Simple Python web server
python -m SimpleHTTPServer
@jefffederman
jefffederman / Webkit CSS hack
Created September 21, 2011 20:06
Webkit CSS hack
/* Webkit hack */
@media screen and (-webkit-min-device-pixel-ratio:0) {
}
@jefffederman
jefffederman / hack.sh
Created March 31, 2012 13:20 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jefffederman
jefffederman / My zsh theme
Created November 20, 2012 01:00
My zsh theme
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[green]%}%? ↵%{$reset_color%})"
local user_host='%{$terminfo[bold]$fg[black]%}%n%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[green]%} %~%{$reset_color%}'
local rvm_ruby=''
if which rvm-prompt &> /dev/null; then
rvm_ruby='%{$fg[black]%}$(rvm-prompt i v g)%{$reset_color%}'
else
if which rbenv &> /dev/null; then
## The quick-and-nasty CVE-2013-0156 Heroku inspector!
## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku
## Download and run using:
## ruby heroku-CVE-2013-0156.rb
`heroku list`.split("\n").each do |app|
app = app.strip
# Some "heroku apps" lines have === formatting for grouping. They're not apps.
next if app[0..2] == "==="
@jefffederman
jefffederman / Controller testing with Rails 3, RSpec and Devise
Last active December 14, 2015 09:19
Controller testing with Rails 3, RSpec and Devise
http://stackoverflow.com/questions/3387485/stubbing-devise-in-rspec-and-rails3/3512813#3512813
Remember to add confirmed_at attribute to User test factory!
@jefffederman
jefffederman / gist:cd60c4cda27fde87a015
Created September 5, 2015 03:29
How I removed ~190MB of image files from my Git repo
app/assets/images/exercises/**/*.
exercise*frame_*.jp{g,eg}
*_thumb.jp{g,eg}
1. Get list of unwanted files
$ git log --raw |awk '/^:/ { if (! printed[$6]) { print $6; printed[$6] = 1 }}'|while read f;do if [ ! -f $f ]; then echo Deleted: $f;fi;done
SEE http://stackoverflow.com/questions/7336252/how-to-remove-all-files-in-a-git-repository-that-are-not-in-the-working-director/7399719#7399719