Ravil Bayramgalin brainopia

View sidekiq_bench.rb
1 2 3 4 5 6 7 8 9 10
require 'benchmark'
require 'sidekiq/limit_fetch'
require 'sidekiq/cli'
 
total = ARGV.shift || 50
concurrency = ARGV.shift || 1
limit = ARGV.shift
 
total = total.to_i
limit &&= limit.to_i
View .editrc
1 2
bind "\e[A" ed-search-prev-history
bind "\e[B" ed-search-next-history
View repro.rb
1 2 3 4 5 6 7 8 9 10
$:.unshift '.'
 
require 'rake'
load 'Rakefile'
load 'rakelib/kernel.rake'
require 'lib/mri_bridge.rb'
require 'lib/melbourne.rb'
require 'lib/compiler'
 
File.to_ast 'kernel/bootstrap/basicobject.rb'
View cassandra-schema_dsl.gemspec
1 2 3 4 5 6 7 8 9 10
Gem::Specification.new do |s|
s.name = 'cassandra-schema_dsl'
s.version = '0.1'
s.author = 'brainopia'
s.summary = 'Cassandra schema dsl'
s.files = ['cassandra-schema_dsl.rb']
s.require_path = '.'
s.add_dependency 'cassandra'
View octokit_mirror.rb
1 2 3 4 5 6 7 8 9 10
class Octokit::Mirror
attr_reader :remaining, :reserved
def initialize(options={})
@client = Octokit::Client.new options
@remaining = Atomic.new Float::INFINITY
@reserved = Atomic.new 0
@monitor = Atomic.new 0
end
View task.rb
1 2 3 4 5 6 7 8 9 10
require 'delegate'
 
class Task
extend Forwardable
def_delegators 'self.class', :collection, :indication
 
class << self
def queues
[OrgRepos, Members, Orgs, Projects, Users, Stars, Contributions]
end
View gist:3910381
1 2 3 4 5 6 7 8 9
require 'eventmachine'
 
class Request < EM::P::HeaderAndContentProtocol
CRLF = "\r\n"
 
def receive_request(headers, body)
receive_full_request headers.join(CRLF) << CRLF*2 << body
end
end
View gist:3910380
1 2 3 4 5 6 7 8 9 10
require 'em-proxy'
 
Proxy.start host: '0.0.0.0', port: ENV['PORT'] do |connection|
connection.server :github, host: 'api.github.com', port: 443
 
ok_response = "HTTP/1.1 200 Ok\r\n\r\n"
connect_verb = /\Aconnect/i
 
connection.on_data do |data|
if data =~ connect_verb
View openssl.sh
1 2 3 4 5 6
cd $rvm_path/src/${MY_RUBY_HOME##*/}/ext/openssl
rvm pkg install openssl
ruby extconf.rb -- --with-openssl-dir="$rvm_path/usr"
make install
cd $rvm_path/usr/ssl
curl http://curl.haxx.se/ca/cacert.pem > cert.pem
View gist:2835713
1 2 3 4 5 6 7 8 9 10
module A
# prefer when there are less than three class methods
# and there are instance methods
def self.boo
end
 
def self.soo
end
 
def fuuu
Something went wrong with that request. Please try again.