Skip to content

Instantly share code, notes, and snippets.

# run Selenium tests on a whole app
./script/server -e test
# followed by
rake test:acceptance
# This is in lieu of running
./script/server -e test
# then browsing to
# Capistrano deployment scripts
# the deployment script will go to default environment (usually "dev"), others like "staging" can be targeted by using "cap staging deploy", etc.
# update the server with the latest revision in the repository
cap deploy
# run rake db:migrate on the server
cap deploy:migrate
# updates the server with the latest project in the repository and then runs rake db:migrate
# Use TextMate as default text editor
export EDITOR="/usr/bin/mate -w"
# Find what port an application is running on.
# Especially useful at Webfaction
ps -ef | grep APPNAME
@randyjhunt
randyjhunt / gist:43184
Created January 4, 2009 21:49
Remove and ignore .DS_Store files in git repository
# Ignore .DS_Store files from a git repository
# Find and remove existing files from the repository:
find . -name .DS_Store -print0 | xargs -0 git-rm
# Add the line ".DS_Store" to the file .gitignore, which can be found at the top level of your repository (or created if it isn't there already)
git add .gitignore
git commit -m ".DS_Store banished!"
# http://stackoverflow.com/questions/107701/how-can-i-remove-dsstore-files-from-a-git-repository
@randyjhunt
randyjhunt / gist:43144
Created January 4, 2009 18:04
exporting and importing MySQL databases
# Export database from MySQL:
sudo mysqldump -u database_username database_name > path_to_file_to_export_to.sql