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
#!/bin/bash | |
echo -n "Dumping database... " | |
if mysqldump -u xxxx mydbname > db/fulldump.sql; then | |
echo "done." | |
echo -n "Committing new changes... " | |
if git add db/fulldump.sql; then | |
echo "done." | |
else | |
echo 'failed!' | |
exit 1 |
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
#!/bin/bash | |
echo -n "Dumping database... " | |
if mysqldump -u xxxx mydbname > db/fulldump.sql; then | |
echo "done." | |
echo -n "Committing new changes... " | |
if git add db/fulldump.sql; then | |
echo "done." | |
else | |
echo 'failed!' | |
exit 1 |
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
# This requires modifications to your personal .bashrc as well as | |
# root's .bashrc (and changes to the sudo setup). It is dirty and | |
# should not ever be used by anyone. Ever. :) | |
########## personal .bashrc ############# | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
export HISTCONTROL=ignoredups |
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
IP=$(wget -qO - http://ww) | |
while [ "$type" != "0" ]; do | |
echo 1 - Eject SCD0 | |
echo 2 - Eject SCD1 | |
echo 3 - Close SCD0 | |
echo 4 - Close SCD1 | |
echo 0 - Quit | |
read -n1 type | |
case "$type" in | |
"1") |
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
This is gist. | |
There are many like it, but this one is mine. | |
It is my life. | |
I must master it as I must master my life. | |
Without me gist is useless. | |
Without gist, I am useless. |
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
# Got a bunch of subdirectories in a project that aren't submodules, but should be? | |
# Here's a quick way to add them all. Just change the find command to only look in | |
# the directory you want. | |
for dir in `find vendor/extensions -type d -name .git`; do url=`cd "$dir" && git config --get remote.origin.url`; dir="${dir%/.git}"; git rm -r --cached "$dir" && git submodule add "$url" "$dir"; done | |
## Or, slightly more readable | |
for dir in `find vendor/extensions -type d -name .git`; do | |
url=`cd "$dir" && git config --get remote.origin.url` |
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
emacs () { | |
if ! /Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n "$@" 2>/dev/null; then | |
open -a Emacs.app && sleep 1 && /Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n "$@" | |
fi | |
} |
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
[format] | |
pretty="format:%C(yellow)%h%Creset %C(magenta bold)%aN%Creset%C(blue) %ad%Creset %s" | |
[log] | |
date=short | |
[alias] | |
amend = commit -v --amend | |
addp = add --patch | |
axe = !sh -c 'git log -S"$0"' |
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
function migrate rollback () { | |
if [ -z "$1" ]; then | |
rake db:"$0" RAILS_ENV=development && rake db:"$0" RAILS_ENV=test | |
else | |
rake db:"$0" RAILS_ENV="$1" | |
fi | |
} |
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
source :gemcutter | |
group :runtime do | |
gem 'sinatra', '~>1.0.0' | |
gem 'rack', '~>1.0.0' | |
end | |
# vim:ft=ruby |
OlderNewer