Skip to content

Instantly share code, notes, and snippets.

View linjunpop's full-sized avatar
🐚
Sleeping

Jun Lin linjunpop

🐚
Sleeping
View GitHub Profile
@linjunpop
linjunpop / Textmate and RVM Gemset
Created November 15, 2011 01:22
Textmate and RVM Gemset
TM_RUBY: /Users/Jun/.rvm/bin/rvm-auto-ruby
GEM_HOME: env | grep GEM_HOME | awk '{ sub(/GEM_HOME=/, ""); print }'
GEM_PATH: env | grep GEM_PATH | awk '{ sub(/GEM_PATH=/, ""); print }'
@linjunpop
linjunpop / Gemfile
Created March 21, 2012 06:27
Capistrano deploy with multistage & gitflow
group :development do
gem 'capistrano'
gem 'capistrano-ext'
gem 'capistrano-gitflow'
gem 'capistrano_colors'
end
@linjunpop
linjunpop / README.md
Created April 5, 2012 01:38
Ctags command for rails project with RVM

Ctags command for rails project with RVM

$ ctags --extra=+f --exclude=.git --exclude=log --exclude=tmp --exclude=public --exclude=spec/fixtures --exclude=db --langmap="ruby:+.rake.builder.rjs" --languages=-javascript -R *
@linjunpop
linjunpop / Mac bootstrap.markdown
Created July 4, 2012 09:15
Mac bootstrap.markdown

install xCode

TODO

install xCode commandline-tools

TODO

install homebrew

@linjunpop
linjunpop / gem_make.out
Created July 10, 2012 07:56
fail to build ruby18_source_location native extensions on rbx-1.2.4
/usr/local/Cellar/rbenv/0.3.0/versions/rbx-1.2.4/bin/rbx extconf.rb
creating Makefile
make
gcc -I. -I/usr/local/Cellar/rbenv/0.3.0/versions/rbx-1.2.4/include -I/usr/local/Cellar/rbenv/0.3.0/versions/rbx-1.2.4/include -I. -I'/usr/local/Cellar/rbenv/0.3.0/versions/rbx-1.2.4/include' -fPIC -ggdb3 -O2 -fPIC -c ruby18_source_location.c
ruby18_source_location.c:2:18: error: node.h: No such file or directory
ruby18_source_location.c:24: error: expected specifier-qualifier-list before ‘NODE’
ruby18_source_location.c:28: error: expected specifier-qualifier-list before ‘NODE’
ruby18_source_location.c: In function ‘Init_ruby18_source_location’:
ruby18_source_location.c:54: error: ‘rb_cUnboundMethod’ undeclared (first use in this function)
@linjunpop
linjunpop / deploy.rb
Created August 2, 2012 03:28
Rails 2.3 capistrano recipe to compile with compass
namespace :compass do
desc 'Updates stylesheets if necessary from their Sass templates.'
task :compile do
run("cd #{latest_release}; bundle exec compass compile --output-style nested --force -e production")
end
end
before 'deploy:restart', 'compass:compile'
@linjunpop
linjunpop / deploy.rb
Created August 8, 2012 09:19
Capistrano recipe for barista
namespace :barista do
desc 'Compile CoffeeScripts.'
task :brew do
run("cd #{latest_release}; RAILS_ENV=#{rails_env} bundle exec rake barista:brew")
end
end
before 'deploy:restart', 'barista:brew'
@linjunpop
linjunpop / README.md
Created August 21, 2012 01:15
Rails flash messages with AJAX requests
@linjunpop
linjunpop / README.md
Created August 24, 2012 07:19
Casperjs HTMLElementObject.click()
@linjunpop
linjunpop / meta_field.rb
Created September 13, 2012 09:11
metadata fields
>> p = Product.create(:name => 'p1', :foobar => true)
>> p.name
=> "p1"
>> p.foobar
=> true