This file contains hidden or 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
| ## Rails 3.0 Template | |
| # Usage: rails app_name -m http://gist.github.com/373297.txt | |
| # Remove normal files we don't want | |
| %w(README public/index.html public/favicon.ico public/robots.txt).each do |f| | |
| remove_file f | |
| end | |
| # Copy database.yml to sample | |
| inside "config" do |
This file contains hidden or 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 'rubygems' | |
| require 'open-uri' | |
| require 'hpricot' | |
| doc = Hpricot(open('http://www.haitisurf.com/dictionary.shtml')) | |
| text_array = (doc/'font'). | |
| collect {|elem| elem.to_plain_text }. | |
| delete_if { |txt| txt == '' }. | |
| select {|txt| txt =~ /.+\-.+/ } |
This file contains hidden or 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
| gem uninstall im_a_gem --install-dir ~/.gem/ruby/1.8 |
This file contains hidden or 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 env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config |
This file contains hidden or 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
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} ^www.mysite.com | |
| RewriteRule (.*) http://mysite.com/ [R=301,L] | |
| </IfModule> |
This file contains hidden or 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
| ## RailsAllowModRewrite | |
| RailsAllowModRewrite On | |
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} ^www.mysite.com | |
| RewriteRule (.*) http://mysite.com/ [R=301,L] |
This file contains hidden or 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/sh | |
| ### BEGIN INIT INFO | |
| # Provides: god | |
| # Required-Start: $all | |
| # Required-Stop: $all | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: God |
This file contains hidden or 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
| In Textmate, go to Preferences -> Advanced -> Folder References. Then find the following File Pattern: | |
| (?!htaccess) | |
| replace with: | |
| (?!(htaccess|git*)) | |
| Restarting Textmate project will now display all files that are called ‘.htaccess’ or start with ‘.git’. |
This file contains hidden or 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
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| PS1="\w\$(parse_git_branch) $ " |
This file contains hidden or 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
| # Step 1 | |
| curl -O http://topfunky.net/svn/shovel/memcached/install-memcached.sh | |
| # Step 2 | |
| mv install-memcached.sh ~/src/memcached | |
| # Step 3 | |
| cd ~/src/memcached | |
| # Step 4 | |
| sudo sh memcached.sh |