Skip to content

Instantly share code, notes, and snippets.

@athom
athom / simple_fiber_concurrency.rb
Created March 14, 2012 08:49 — forked from aprescott/simple_fiber_concurrency.rb
Simple example of concurrency in Ruby with Fiber.
require "fiber"
f1 = Fiber.new { |f2| f2.resume Fiber.current;loop{puts "A"; f2.transfer} }
f2 = Fiber.new { |f1| f1.transfer; loop{puts "B"; f1.transfer} }
f1.resume f2
@athom
athom / acm_bot.rb
Created July 7, 2011 07:05 — forked from JulesWang/acm_bot.rb
A acm bot do some boring work
# Ruby 1.9.2
# Home: https://gist.github.com/856219
# My CPP template: template_cpp.rb
# OJ Support:
# Online Judge of Zhejiang University
# Author: w.jq0722@gmail.com
require 'uri'
require 'net/http'
#require 'hpricot'