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
parse_git_branch() { | |
raw_git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(git::\1)/' | |
} | |
parse_svn_branch() { | |
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk -F / '{print "(svn::"$1 "/" $2 ")"}' | |
} | |
parse_svn_url() { | |
svn info 2>/dev/null | grep -e '^URL*' | sed -e 's#^URL: *\(.*\)#\1#g ' | |
} | |
parse_svn_repository_root() { |
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
comment.request = stub(Object.new) do |request| | |
request.remote_ip {'ip'} | |
request.env {{ 'HTTP_USER_AGENT' => 'agent', 'HTTP_REFERER' => 'referrer' }} | |
end |
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
class Erector::Inline | |
def method_missing(method_name, *args, &block) | |
if method_name.to_s =~ /!$/ && parent.respond_to?(method_name.to_s.gsub(/!$/, "")) | |
return_value = parent.send(method_name.to_s.gsub(/!$/, ""), *args, &block) | |
text!(return_value) if return_value.is_a?(String) | |
return_value | |
else | |
parent.send(method_name, *args, &block) | |
end | |
end |
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
var someHost = http.createClient(80, "somehost.com"); | |
var request = someHost.request(method, path, params); | |
var response; | |
request.addListener('response', function () { | |
response = arguments[0] | |
response.body = "" | |
response.addListener("data", function (chunk) { | |
response.body += chunk; | |
}); | |
response.addListener('end', function () { |
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
require 'benchmark' | |
Benchmark.bm do |x| | |
x.report("baseline") {} | |
x.report("require rubygems") {require 'rubygems'} | |
x.report("require bundler") {require 'bundler'} | |
x.report("Bundler.require(:benchmark)") {Bundler.require} | |
end |
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
namespace rb TcUser.Thrift | |
namespace py userservice | |
exception UserGetError { | |
1: string reason | |
} | |
exception UserCreateError { | |
1: map<string,list<string>> errors | |
} |
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
describe UserService do | |
attr_reader :client_iprot, :client_iprot_transport, :client_oprot, :client_oprot_transport, :server_iprot, :server_iprot_transport, :server_oprot, :server_oprot_transport, :client, :server_handler, :server_processor | |
before do | |
@client_iprot_transport = ::Thrift::MemoryBufferTransport.new | |
@client_iprot = ::Thrift::BinaryProtocol.new(client_iprot_transport) | |
@client_oprot_transport = ::Thrift::MemoryBufferTransport.new | |
@client_oprot = ::Thrift::BinaryProtocol.new(client_iprot_transport) | |
@client = UserService::Client.new(client_iprot, client_oprot) | |
@server_iprot_transport = ::Thrift::MemoryBufferTransport.new |
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
var MyMixin = { | |
bar: function() { | |
return "MyMixin bar"; | |
} | |
}; | |
describe("First Level", function() { | |
var variableFn = function() { | |
return "First Level variableFn"; | |
}; |
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
echo | |
null | |
id | |
25818655 | |
import_id | |
25818655 |
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
#!/usr/bin/env babel-node | |
var fs = require('fs') | |
, path = require('path') | |
, browserify = require('browserify') | |
, babelify = require('babelify') | |
, riotify = require('riotify') | |
, uglify = require('uglify-js2') | |
, watchify = require('watchify') | |
, gzipSize = require('gzip-size') | |
, source = require('vinyl-source-stream') |