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
# Previous one is unsafe | |
you should take a look at this: https://github.com/raggi/openssl-osx-ca |
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
# Ruby 1.9 | |
4.2.object_id == 4.2.object_id # => false | |
# Ruby 2.0 | |
warn "Optimization only on 64 bit systems" unless 42.size * 8 == 64 | |
4.2.object_id == 4.2.object_id # => true (4.2 is immediate) | |
4.2e100.object_id == 4.2e100.object_id # => false (4.2e100 isn't) |
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
See comments! |
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
" moved to https://github.com/DAddYE/soda.vim |
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
export CONFIGURE_OPTS="\ | |
--disable-install-doc \ | |
--with-readline-dir=$(brew --prefix readline) \ | |
--with-openssl-dir=$(brew --prefix openssl) | |
--with-yaml-dir=$(brew --prefix yaml) \ | |
--with-gdbm-dir=$(brew --prefix gdbm) \ | |
--with-libffi-dir=$(brew --prefix libffi)" |
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
module Async | |
class Queue | |
attr_reader :worker, :concurrency | |
attr_accessor :saturated, | |
:drain | |
def initialize(concurrency, &block) | |
@worker = block | |
@workers = 0 | |
@concurrency = concurrency |
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 ApplicationController < ActionController::Base | |
around_filter :disable_gc | |
private | |
def disable_gc | |
GC.disable | |
begin | |
yield | |
ensure |
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 | |
if ARGV[0] | |
signal = | |
case ARGV[0] | |
when 'wait' then :USR1 | |
when 'restart' then :USR2 | |
end | |
Process.kill(signal, ARGV[1].to_i) |
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
require "fiber" | |
f1 = Fiber.new do |f2| | |
while true | |
puts "A" | |
sleep 2 | |
f2.transfer | |
end | |
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
module EventMachine | |
def self.system3(cmd, *args, &cb) | |
cb ||= args.pop if args.last.is_a? Proc | |
init = args.pop if args.last.is_a? Proc | |
# merge remaining arguments into the command | |
cmd = ([cmd] + args.map{|a|a.to_s.dump}).join(' ') | |
new_stderr = $stderr.dup |