Skip to content

Instantly share code, notes, and snippets.

View linjunpop's full-sized avatar
👻
🤗

Jun Lin linjunpop

👻
🤗
View GitHub Profile
@linjunpop
linjunpop / README.md
Created October 29, 2012 06:34
Git basic

Git basic

Commit

Pricinple

  • One commit one small feature or bug fix
  • Include unit test in one commit
  • Exclude non-associated files
  • Don't commit un-finished or wrong code
@linjunpop
linjunpop / _document_fields.html.slim
Created October 24, 2012 09:07
Nested form and twitter bootstrap css.
- if f.object.file?
= f.input :file, label: false, wrapper: :append do
= f.input_field :file, as: :string, readonly: true
span
= link_to 'Download', f.object.file_url, class: 'btn'
= f.link_to_remove 'Remove document', class: 'btn btn-danger'
- else
= f.input :file, label: false, wrapper: :append do
= f.input_field :file, as: :file
span
@linjunpop
linjunpop / rails2-stl-cache_classes-issue.md
Created September 26, 2012 07:39
Rails 2 STI changes behavior depending on environment
@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
@linjunpop
linjunpop / README.md
Created August 24, 2012 07:19
Casperjs HTMLElementObject.click()
@linjunpop
linjunpop / README.md
Created August 21, 2012 01:15
Rails flash messages with AJAX requests
@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 / 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 / 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 / Mac bootstrap.markdown
Created July 4, 2012 09:15
Mac bootstrap.markdown

install xCode

TODO

install xCode commandline-tools

TODO

install homebrew