Skip to content

Instantly share code, notes, and snippets.

View JangoSteve's full-sized avatar

Steve Schwartz JangoSteve

View GitHub Profile
@JangoSteve
JangoSteve / .gitattributes
Created January 15, 2012 18:23
Example .gitattributes for jasmine-given
spec/ export-ignore
src/ export-ignore
.gitignore export-ignore
Gemfile export-ignore
Gemfile.lock export-ignore
Guardfile export-ignore
Rakefile export-ignore
@JangoSteve
JangoSteve / commands.sh
Last active September 28, 2015 10:58
Cloning and filtering file to new repo
git clone --no-hardlinks orig_repo new_repo
cd new_repo
git filter-branch --subdirectory-filter directory/containing/desired/file --prune-empty HEAD
git reset --hard
rm -rf .git/refs/original/
git remote rm origin
git update-ref -d refs/original/refs/heads/master
git reflog expire --expire=now --all
git gc --aggressive --prune=now
git repack -ad
@JangoSteve
JangoSteve / cache.rake
Created November 17, 2011 03:32
Automatically cache pages in Rails, put this in /lib/tasks/cache.rake
# See rails source:
# https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/caching/pages.rb
#
# Turn on caching in development, by changing this line to true in config/environments/development.rb:
#
# config.action_controller.perform_caching = true
#
# Then run:
#
# bundle exec rake pages:cache
@JangoSteve
JangoSteve / .gitignore
Created November 16, 2011 04:43
Global .gitignore in ~/.gitignore
Procfile.me
.sass-cache/
@JangoSteve
JangoSteve / ps1.custom.sh
Created November 16, 2011 02:10
Custom ps1 bash customization in ~/.bash_profile_includes/ps1.custom.sh
############################################
# Modified from emilis bash prompt script
# from https://github.com/emilis/emilis-config/blob/master/.bash_ps1
#
# Modified for Mac OS X by
@JangoSteve
JangoSteve / to_haml.rb
Created November 14, 2011 06:14
Converting all ERb views to Haml, modified from http://snippets.dzone.com/posts/show/5449
require 'hpricot'
require 'ruby_parser'
class ToHaml
def initialize(path)
@path = path
end
def convert!
Dir["#{@path}/**/*.erb"].each do |file|
@JangoSteve
JangoSteve / gist:1340366
Created November 4, 2011 20:12
Installing gems with native extensions
# Installing ruby-debug19 with ruby-1.9.3
gem install ruby-debug19 -- --with-ruby-include="$rvm_path/src/$(rvm tools identifier)/"
@JangoSteve
JangoSteve / .janus.rake
Created November 2, 2011 06:46
local customized macvim janus raketask - ~/.janus.rake
skip_vim_plugin "nerdtree"
vim_plugin_task "nerdtree-scrooloose", "git://github.com/scrooloose/nerdtree.git"
@JangoSteve
JangoSteve / .gvimrc.local
Created November 2, 2011 06:45
macvim local customizations - ~/.gvimrc.local
color jellybeans+
let NERDTreeDirArrows = 1
let NERDTreeMouseMode = 1
" <Ctrl-l> redraws the screen and removes any search highlighting.
nnoremap <silent> <C-l> :nohl<CR><C-l>
@JangoSteve
JangoSteve / rails.sh
Created November 2, 2011 06:41
rails aliases for bash profile - ~/.bash_profile_includes/rails.sh
alias rs="rails s"
alias rc="rails c"
alias ber="bundle exec rspec"