Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@dv
dv / Capfile
Created April 10, 2014 11:27
Capistrano 3 + Rails 4 + Whenever + DelayedJob + Nginx + Postgresql
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Rails (includes bundler, rails/assets and rails/migrations)
require 'capistrano/rails'
# Whenever
anonymous
anonymous / gist:4591596
Created January 22, 2013 02:34
require 'llvm/core'
require 'llvm/execution_engine'
require 'llvm/transforms/scalar'
class Generator
attr_accessor :ptr
def build(code,name, mod)
@igrigorik
igrigorik / client.rb
Created January 22, 2012 21:12
chunked file stream with goliath
require 'bundler'
Bundler.require
url = 'http://0.0.0.0:9000/images/avatar.png'
EM.run do
http = EventMachine::HttpRequest.new(url).get
http.stream {|chunk| print [:chunk, chunk.size] }
http.headers {|h| p [:headers, h] }
@iragsdale
iragsdale / async_resolver.rb
Created November 4, 2010 22:07
Asynchronous DNS resolver based on EventMachine and net-dns
require 'eventmachine'
require 'net/dns'
require 'net/dns/resolver'
module EM # :nodoc:
module Protocols
include Logger::Severity
class AsyncResolver < Net::DNS::Resolver