Skip to content

Instantly share code, notes, and snippets.

View elianderson's full-sized avatar

Eli Anderson elianderson

View GitHub Profile
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@elianderson
elianderson / activeadmin-cancan.rb
Created December 6, 2012 15:29
Deep integration of CanCan into ActiveAdmin
# blog post:
# Before using this initializer, you must set up Cancan. First, add the gem to your Gemfile:
#
# gem 'cancan'
#
# Next, generate and edit an Ability class:
#
# rails generate cancan:ability
#
@elianderson
elianderson / gist:1705900
Created January 30, 2012 18:45 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@elianderson
elianderson / gist:1705899
Created January 30, 2012 18:45 — forked from joshellington/gist:1705896
HTML5 Boilerplate Downloader Alias
alias html5='wget --no-check-certificate http://github.com/h5bp/html5-boilerplate/zipball/v2.0stripped ./; mv ./v2.0stripped ./boilerplate.zip; unzip boilerplate.zip; mv h5bp-html5-boilerplate-*/* .; rm -rf ./boilerplate.zip; rm -rf ./h5bp-html5-*;'
@elianderson
elianderson / gist:1328538
Created October 31, 2011 19:10
Ruby sever Load out of control
is your load out of control? try this.
The file will be /etc/apache2/mods-enabled/passenger.conf
There is a line I added in there about max instances
If you make it the number of cores you have in your host instance (4 in this case)
Stop Apache
Then make sure no Ruby procs are left over
Then start Apache
The problem should go away
I don't expect it to happen again
@elianderson
elianderson / gist:1319886
Created October 27, 2011 15:28
Ruby Iframe Sessions
Make sure you use:
response.headers["P3P"] = 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'
otherwise IE will not accept the session ;)
back to work.
@elianderson
elianderson / gist:1310650
Created October 24, 2011 23:06
Random Ruby App issue
This one stumped me for about 5 hours.
Passenger Error: invalid byte sequence in US-ASCII
using padrino
add this to your boot.rb:
Encoding.default_external = Encoding::UTF_8
@elianderson
elianderson / gist:1189015
Created September 2, 2011 16:01
Lost git after upgrade to Lion
The solution:
sudo ln -s /usr/local/git/bin/git /usr/local/bin/
@elianderson
elianderson / gist:1114393
Created July 29, 2011 18:18
GIT commands
Remove tracking on a file (that is in your git ignore already but in the repo) but not delete it:
git rm -r --cached supersecretpasswords.txt
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #