Skip to content

Instantly share code, notes, and snippets.

View croby's full-sized avatar

Chris Roby croby

  • Rover.com
  • Seattle, WA
View GitHub Profile
@croby
croby / gist:4533461
Last active December 11, 2015 02:49
Changing a non-primary-key column to a Rails-standard `id` primary key column, and back down again
def up
rename_column :table_name, :old_id_col, :id
change_column :table_name, :id, :primary_key
end
def down
rename_column :table_name, :id, :old_id_col
change_column :table_name, :old_id_col, :integer, :null => true
remove_column :table_name, :id
end
@croby
croby / ssl_nginx.conf
Created December 8, 2011 17:39
nginx SSL sample configuration
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 443;
server_name localhost;
@croby
croby / gist:1014986
Created June 8, 2011 18:17
add to your bash .profile
# hide and show finder desktop
alias hidedesktop='defaults write com.apple.finder CreateDesktop -bool false && killall Finder'
alias showdesktop='defaults write com.apple.finder CreateDesktop -bool true && killall Finder'