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
. | |
.:::. | |
.:::::::. | |
V^V^V^V^V^V Ahhhhhh! | |
(| ^ ^ |) #{the_wise_man} | |
| (_) | #{speaks} | |
`//=\\' | |
(((())) | |
)))(( | |
(()))) |
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
# add in your .bashrc | |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# http://blog.cyberion.net/2009/01/improved-bash-prompt-for-git-usage.html | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master⚡]$ # dirty working directory | |
# | |
# I've made the following ajustements: | |
# - Use of plumbing, that should be faster than git status porcelain. | |
# - Don't show my repo as dirty if it has files unknown from the index (I always have). |
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 'activerecord' | |
DB_HOST = 'localhost' | |
DB_USER = 'username' | |
DB_PASS = 'password' | |
DB_NAME = 'database' | |
class Movie < ActiveRecord::Base | |
class << self |
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
# sample synergy configuration file | |
# | |
# comments begin with the # character and continue to the end of | |
# line. comments may appear anywhere the syntax permits. | |
section: screens | |
macmini: | |
laptop: | |
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
<?php // drop wp_ tables | |
// Set to your db | |
$database = 'my_db'; | |
// Add your user/pass | |
if ( ! mysql_connect('localhost', 'username', 'password')) | |
{ | |
die("Couldn't connect to db. MySQL Error (".mysql_errno()."): ".mysql_error()); | |
} |
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
def validate_email_address(address) | |
address.match(/^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|jobs|museum)$/i).nil? ? false : true | |
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
# copy_gems.rb | |
# Run on Computer A to generate copy_gems.sh | |
# Run copy_gems.sh on Computer B to install all gems (including all versions) | |
list = `sudo gem list --local` | |
output = "#!/bin/bash\n" | |
list.each_line do |line| | |
name, ver = line.split(" (") | |
ver.gsub(/[\(|\)]/, '').split(', ').each { |v| output << "sudo gem install #{name.chomp} -v #{v.chomp} --no-rdoc --no-ri\n" } | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>beforeRunningCommand</key> | |
<string>nop</string> | |
<key>command</key> | |
<string> | |
if [ "$SSH_KEY" != "" ] && [ "$SSH_HOST" != "" ] && [ "$SSH_USER" != "" ] && [ "$SSH_REMOTE_PATH" != "" ]; then |
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 function performs host completion based on ssh's known_hosts files, | |
# defaulting to standard host completion if they don't exist. | |
# | |
_known_hosts() | |
{ | |
local cur curd ocur user suffix aliases global_kh user_kh hosts i host | |
local -a kh khd config | |
COMPREPLY=() | |
cur=`_get_cword` |
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 | |
sudo gem install abstract -v 1.0.0 --no-rdoc --no-ri | |
sudo gem install actionmailer -v 2.3.2 --no-rdoc --no-ri | |
sudo gem install actionmailer -v 2.2.2 --no-rdoc --no-ri | |
sudo gem install actionmailer -v 1.3.6 --no-rdoc --no-ri | |
sudo gem install actionmailer -v 1.3.3 --no-rdoc --no-ri | |
sudo gem install actionpack -v 2.3.2 --no-rdoc --no-ri | |
sudo gem install actionpack -v 2.2.2 --no-rdoc --no-ri | |
sudo gem install actionpack -v 1.13.6 --no-rdoc --no-ri | |
sudo gem install actionpack -v 1.13.3 --no-rdoc --no-ri |