Skip to content

Instantly share code, notes, and snippets.

View jefffederman's full-sized avatar

Jeff Federman jefffederman

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jefffederman on github.
  • I am jefffederman (https://keybase.io/jefffederman) on keybase.
  • I have a public key whose fingerprint is 0F0D AF33 381D FE79 0AC7 2508 11A9 D977 4FB0 59CB

To claim this, I am signing this object:

@jefffederman
jefffederman / setting-up-vim
Created January 10, 2016 14:15
Setting up a slick looking Vim
Get patched Powerline fonts:
https://github.com/powerline/fonts
@jefffederman
jefffederman / naming-git-branches.md
Last active February 12, 2024 08:39
Naming `git` branches

Naming git branches

tldr; {type}/{group[optional]}/short-form-of-what-it-does

HCM developers consistently use dash-delimited branch names. About half also use f/ and b/ prefixes ('feature' and 'bug', respectively).

I suggest we continue our current practices, specifically:

  • a branch should start with a prefix indicating its type: feature/, bug/, chore/, or hotfix/
  • prefer the whole word to the one letter abbreviation, the clarity outweighs the cost of the extra characters
@jefffederman
jefffederman / gist:5824c7479834e6e6f915
Last active November 3, 2015 18:56 — forked from kyledrake/gist:d7457a46a03d7408da31
Creating a self-signed SSL certificate, and then verifying it on another Linux machine
# Procedure is for Ubuntu 14.04 LTS.
# TODO for OS X
# Using these guides:
# http://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/
# https://turboflash.wordpress.com/2009/06/23/curl-adding-installing-trusting-new-self-signed-certificate/
# https://jamielinux.com/articles/2013/08/act-as-your-own-certificate-authority/
# Generate the root (GIVE IT A PASSWORD IF YOU'RE NOT AUTOMATING SIGNING!):
openssl genrsa -aes256 -out ca.key 2048
@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
@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!
## 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 / 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
@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 / Webkit CSS hack
Created September 21, 2011 20:06
Webkit CSS hack
/* Webkit hack */
@media screen and (-webkit-min-device-pixel-ratio:0) {
}