- Install
hubgem. - Create a github issue.
git co -b feature/awesome origin/developmentand add commits to your source codes.git push origin HEADhub pull-request -i {issue_no} -h {upstream_repository_owner}:{branch_for_pull_request}, then the commits appears in the issue.- Review and do
Merge pull request
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
| http://stackoverflow.com/questions/13963404/rails-and-os-x-how-to-install-rmagick | |
| $ cd `Magick-config --prefix`/lib | |
| $ for f in libMagick*-*.[0-9].dylib; do ln -s $f `echo $f | sed -e 's/-.*\.dylib/.dylib/'`; done |
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
| I try to install libxml-ruby-2.3.3 at MacOSX Marvericks via gem (rbenv, Ruby-2.1.0), get below errors: | |
| Building native extensions. This could take a while... | |
| ERROR: Error installing libxml-ruby: | |
| ERROR: Failed to build gem native extension. | |
| /Users/***/.rbenv/versions/2.1.0/bin/ruby extconf.rb | |
| extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config. | |
| extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config. | |
| checking for socket() in -lsocket... no |
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
| # use twitter.gem earlier than 5.0.0 | |
| require "pp" | |
| require "twitter" | |
| # 1. Comment out oauth_token and oauth_token_secret. | |
| # 2. Visit https://dev.twitter.com/apps/new. Get consumer_key and consumer_secret. | |
| # 3. Execute. | |
| # 4. Visit the Developper's site agein. | |
| # 5. Go to "settings", and get oauth_token and oauth_token_secret. |
admins = User.where(:kind => :admin).where_values.reduce(:and)
authors = User.where(:kind => :author).where_values.reduce(:and)
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 runner "ApplicationController.allow_forgery_protection = false; s = ActionDispatch::Integration::Session.new(Rails.application); s.post('/login', user: {login: 'admin', password: 'password'}); s.get('/my'); puts s.response.body" |
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
| awk '/^Started /{t=$8} /^Completed /{print t,$5,$7,$10}' log/production.log | sort -k 2,2nr | head -20 |
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
| ApplicationController.allow_forgery_protection = false | |
| app.instance_eval do | |
| post('/login', user: {login: 'bob', password: 'pass'}) | |
| get("/my") | |
| puts response.body | |
| end |
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
| #!/usr/bin/env ruby | |
| buf = {} | |
| ARGF.readlines.each do |l| | |
| case l.chomp | |
| when /^Started ([^\s]+) "([^\s]+)" .* at ([-0-9]+) ([:0-9]+).*/ | |
| _, method, path, date, time = Regexp.last_match.to_a | |
| buf.merge!(:method => method, :path => path, :date => date, :time => time) | |
| when /^Completed/ | |
| puts "%s %s %s" % [buf[:time], buf[:method], buf[:path]] |
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
| class FoosController < ApplicationController | |
| skip_before_filter :verify_authenticity_token | |
| end | |
| $ curl -i -X PUT -H "Content-Type: application/json; charset=utf-8" -d '{"title": "hoge"}' http://localhost:3000/foos/123.json |