This file contains 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
# ~/.bashrc | |
# vim:set ft=sh sw=2 sts=2: | |
source "$HOME/.hashrc" | |
# Store 10,000 history entries | |
export HISTSIZE=10000 | |
# Don't store duplicates | |
export HISTCONTROL=erasedups | |
# Append to history file |
This file contains 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
#file name and path app/models/user.rb | |
class User | |
attr_encrypted :bank_account_number, key: ENV['salt'] | |
end |
This file contains 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
#lib/tasks/db.rake | |
namespace :db do | |
desc "Import most recent database dump" | |
task :import_from_prod => :environment do | |
puts 'heroku run pg:backups capture --app sushi-prod' | |
restore_backup 'sushi-prod' | |
end | |
def path_to_heroku | |
['/usr/local/heroku/bin/heroku', '/usr/local/bin/heroku'].detect {|path| File.exists?(path)} |
This file contains 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
alias git_reset_all='git reset --hard HEAD' | |
alias find_large_files='find . -type f -size +10000k -exec ls -lh {} \;' | |
alias push_github="gp" | |
alias db_up="up" | |
alias bashrc="vim ~/.bashrc.local" | |
alias up="rake db:migrate db:test:prepare" | |
alias down="rake db:rollback" | |
alias cucumber='bundle exec cucumber' | |
alias bottle="git add . && git stash" | |
alias poop="git stash pop" |
This file contains 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
class Users::RegistrationsController < Devise::RegistrationsController | |
layout :choose_layout | |
expose(:selected_plan) { Plan.find_by_slug(params[:plan]) } | |
after_filter :after_registration, :only => [:create] | |
def choose_layout | |
if params[:action] == 'edit' or params[:action] =='update' or params[:action] =='change_password' | |
'users/default' |
This file contains 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 PATH=${PATH}:/Applications/adt-bundle-mac/sdk/tools | |
export PATH=${PATH}:/Applications/adt-bundle-mac/sdk/platform-tools | |
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi | |
[[ -r $rvm_path/scripts/completion ]] && source $rvm_path/scripts/completion | |
#opexport PS1="\u:~$ " | |
vim() { | |
(unset GEM_PATH GEM_HOME; command vim "$@") | |
} |
This file contains 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
#!/usr/bin/php | |
<?php | |
# Git Prepare Commit Message Hook Script | |
# | |
# Location: <repository>/.git/hooks/prepare-commit-msg | |
# | |
# This script will automatically add the correct | |
# Pivotal Ticket ID to the beginning of each commit message | |
# When the branch ID is starts with the Pivotal Message ID. |
This file contains 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
require 'uri' | |
enc_uri = URI.escape("http://example.com/?a=\111\\115"") | |
p enc_uri | |
# => "http://example.com/?a=%09%0D" | |
p URI.unescape(enc_uri) | |
# => "http://example.com/?a=\t\r" |
This file contains 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
class UsersController < ApplicationController | |
def new | |
@user = User.new | |
end | |
def create | |
@user = User.new(params[:user]) | |
if @user.save | |
flash[:notice] = "You have successfully registered, please log in!" |
This file contains 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
uEgvHsY8YQDukiNnho1xMzJrjSiDXAhWRFwRunhmLfPIHQGayk |
NewerOlder