Gem Rakefile from: wycats
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
Loading development environment (Rails 2.3.5) | |
/home/jshsu/.rvm/gems/ruby-1.9.1-p378@webadmit/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement | |
/home/jshsu/.rvm/gems/ruby-1.9.1-p378@webadmit/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `rescue in rescue in establish_connection': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (no such file to load -- pg_ext) (RuntimeError) | |
from /home/jshsu/.rvm/gems/ruby-1.9.1-p378@webadmit/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:73:in `rescue in establish_connection' | |
from /home/jshsu/.rvm/gems/ruby-1.9.1-p378@webadmit/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:68:in `establish_connection' | |
from /home/jshsu/.rvm/gems/ruby-1.9. |
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 super_zoom /bar toggle buffers; /bar toggle nicklist; /bar toggle highmon; /window zoom | |
/key bind meta-Z /super_zoom |
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
sudo aptitude install unixodbc unixodbc-dev freetds-dev sqsh tdsodbc |
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
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold |
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/env bash | |
remote=$1; branch=$2 | |
if [[ -n "$remote" && -n "$branch" ]]; then | |
git push $remote $branch | |
git branch --set-upstream $branch $remote/$branch | |
else | |
echo "Usage:" | |
echo " git pt <remote> <branch>" | |
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
# install redis | |
git clone [email protected]:jhsu/redis-shelf.git | |
cd redis-self | |
gem install yaml redis shotgun thin | |
redis-server | |
shotgun config.ru -s thin # starts server on :3000 |
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/env bash | |
echo "WTF commit count:" | |
git log --graph --pretty=format:"%Cred%h%Creset . %an: %s %Cgreen(%cr)%Creset" --abbrev-commit --date=relative --grep=wtf -i | grep -i -v 'merge' | wc -l |
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
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!( | |
:simple => "%I:%M %p %Z, %Y-%m-%d", | |
:month_year => '%b %Y', | |
:month => '%B', | |
:year => '%Y', | |
:day_of_week => '%a', | |
:day => '%Y-%b-%d', | |
:date => '%Y-%b-%d', | |
:default => '%b %d, %Y at %I:%M %p %Z', | |
:datetime => '%Y-%m-%d at %I:%M %p %Z', |
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
# Project Euler problem #8 | |
# Find the greatest product of five consecutive digits in the 1000-digit number. | |
# This solution sorts each series of 5 digits by larger to lower digits (ie 54321) and and finds | |
# the largest number, since that would mean the series with the most larger numbers, then find the | |
# product of those digits. This is much more efficient than the one below. | |
# -- Joseph Hsu | |
long_number = <<NUMBER | |
73167176531330624919225119674426574742355349194934 |