This file contains hidden or 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
# define your BUNDLE_GEMFILE environment variable | |
# NOTE: Ubuntu users must use .bashrc instead of .bash_profile | |
echo "export BUNDLE_GEMFILE=Gemfile.dev" >> ~/.bash_profile | |
# reload your terminal | |
source ~/.bash_profile | |
# install the bundler gem | |
gem install bundler |
This file contains hidden or 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
export BASE_DENSITY=72 | |
export DESIRED_RESOLUTION=1600 | |
export TARGET_DENSITY=$(identify -density $BASE_DENSITY -format "%[fx:min($BASE_DENSITY*$DESIRED_RESOLUTION/w*2,$BASE_DENSITY*$DESIRED_RESOLUTION/h*2)]" IllustratorEPSfile.eps) | |
convert -density $TARGET_DENSITY -channel rgba -alpha on -colorspace rgb -scale 50% IllustratorEPSfile.eps IllustratorEPSfile.png |
This file contains hidden or 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
# ~/.ssh/config | |
Host github-as-deploy | |
HostName github.com | |
User git | |
IdentityFile /home/info/.ssh/dev3dynamic-deploy-key | |
# test with | |
ssh -T github-as-deploy |
This file contains hidden or 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
# From http://mislav.uniqpath.com/2010/07/git-tips/ | |
# git push will by default push all branches that have the same name on the remote. | |
# To limit this behavior to just the current branch, set this configuration option: | |
git config --global push.default tracking | |
git config push.default tracking | |
# pushes the "master" branch to "origin" remote and sets up tracking |
This file contains hidden or 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
" Add this to your ~/.vimrc to allow you do :Rcache activity_json | |
" to open app/cache/activity_json_cache.rb | |
autocmd User Rails Rnavcommand cache app/cache -glob=**/* -suffix=_cache.rb |
This file contains hidden or 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
# app/modes/session.rb | |
class Session < ActiveRecord::Base | |
named_scope :unactive_for, lambda{|period| {:conditions => ['sessions.updated_at <= ?', Time.now - period]}} | |
def self.purge_older_than period | |
unactive_for(period).find_in_batches do |sessions| | |
sessions.each{|s| "#{s.id}: s.destroy"} | |
end | |
end | |
end |
This file contains hidden or 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
## ~/bin/uk-keyb.sh | |
#!/bin/bash | |
setxkbmap -model pc105 -layout gb -variant mac | |
xmodmap ~/.Xmodmap.mac | |
## ~/.Xmodmap.mac | |
! Swap Alt and Cmd keys. | |
keycode 37 = Control_L | |
keycode 133 = Alt_L Meta_L |
This file contains hidden or 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
sudo apt-get install curl git-core ruby zlib1g-dev libxml2-dev mysql-client libsqlite3-dev libmysql-ruby libmysqlclient-dev libssl-dev libxslt-dev libreadline-dev zlib1g-dev | |
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
source ~/.bashrc | |
rvm install 1.8.7 | |
# Optionally you can do this instead of installing the Ubuntu package for zlib and readline | |
# rvm package install readline | |
# rvm package install zlib |
This file contains hidden or 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
# This is for installing RVM on your machine with all the needed development libs. | |
# You can skip this if you have RVM already working. | |
sudo apt-get install curl git-core ruby zlib1g-dev libxml2-dev mysql-client libsqlite3-dev libmysql-ruby libmysqlclient-dev libssl-dev libxslt-dev libreadline-dev zlib1g-dev | |
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
source ~/.bashrc | |
# To install Ruby 1.9.2 | |
rvm install 1.9.2 | |
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc | |
echo "\nrvm 1.9.2" >> ~/.bashrc |
This file contains hidden or 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
" Replace all <% whatever do %> with <%= whatever do %> | |
:args app/views/*/* | |
:argdo %s/<% \(.*\) do \(.*\) %>/<%= \1 do \2 %>/ge | update |