Skip to content

Instantly share code, notes, and snippets.

include the below lines in the <head> section
<!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
<!--[if lt IE 8]><%= stylesheet_link_tag 'blueprint/ie' %><![endif]-->
export PS1="\[\033[00m\]\u@\h\[\033[00m\]:\[\033[00m\]\w\[\033[00m\] \`ruby -e \"print (%x{git branch 2> /dev/null}.split(%r{\n}).grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[00m\]$\[\033[00m\] "
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
PS1="\$(~/.rvm/bin/rvm-prompt) $PS1"
@luckydev
luckydev / to_show_git_branch_and_ruby_version
Created September 24, 2010 08:07
how to display ruby version and git branch in terminal prompt
export PS1="\[\033[00m\]\u@\h\[\033[00m\]:\[\033[00m\]\w\[\033[00m\] \`ruby -e \"print (%x{git branch 2> /dev/null}.split(%r{\n}).grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[00m\]$\[\033[00m\] "
PS1="\$(~/.rvm/bin/rvm-prompt) $PS1"
@luckydev
luckydev / to install mysql gem
Created September 28, 2010 18:10
install mysql as rvm gem
# to install mysql as rvm gem instead of system gem
env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
@luckydev
luckydev / How RVM can be used for projects
Created November 13, 2010 08:07
gemset instructions for example
### How RVM can be used to manage multiple projects in multiple ruby environments #####
$ rvm install ruby-1.9.2
...
$ rvm list
rvm rubies
@luckydev
luckydev / paperclip and s3
Created November 20, 2010 20:40
paperclip and s3
#example code to use paperclip and s3
has_attached_file :photo,
:style=>{:thumb => "35x35",:medium=>"175x175"},
:storage => :s3,
:s3_credentials => "#{Rails.root.to_s}/config/s3.yml"
@luckydev
luckydev / install mysql gem
Created November 23, 2010 12:34
to install mysql gem
#to install mysql gem as system gem
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
@luckydev
luckydev / _form.html.erb
Created November 25, 2010 19:39
time_select error fix
# form related code ....
<%= f.time_select :end_time, :include_blank=>false, :ignore_date=>false %>
# form related code ...
@luckydev
luckydev / mysql2 adapter
Created December 7, 2010 10:27
mysql2 nil class error.
Occasional `undefined method 'each' for nilclass` in mysql2_adapter.rb
solution ==> update to 0.2.6 gem. works well with rails 3.0.1
@luckydev
luckydev / testing.rb
Created December 8, 2010 13:32
testing file
p "testing "