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
| # http://xrtc.net/f/projects/rcs-to-git.shtml | |
| $ mkdir repos.cvs repos.source | |
| $ cvs -d /path/to/repos.cvs/ init | |
| $ (cd repos && find . -type d -exec mkdir /path/to/repos.cvs/{} \;) | |
| $ (cd repos.source && CVSROOT=/path/to/repos.cvs/ cvs import -m "Initial CVS import" repos.source TICALC start) | |
| $ (cd repos && find . -type f -exec cp {} /path/to/repos.cvs/{} \;) | |
| $ CVSROOT=/path/to/repos.cvs git cvsimport -C . repos.source | |
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
| > tar xfz source-0.0.1.tar.gz | |
| > cd source-0.0.1 | |
| > dh_make | |
| > sudo dpkg-buildpackage -rfakeroot | |
| > dpkg-buildpackage | |
| > sudo dpkg -i ../source-0.0.1-1_amd64.deb |
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 | |
| require 'rubygems' | |
| require 'mechanize' | |
| require 'uri' | |
| class HttpClient | |
| def initialize(base_url) |
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 |
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
| 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
| 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
| 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" |
- 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
OlderNewer