Skip to content

Instantly share code, notes, and snippets.

View yawn's full-sized avatar
😷
3密

Joern Barthel yawn

😷
3密
  • Berlin
View GitHub Profile
@yawn
yawn / gist:1275110
Created October 10, 2011 11:42
FSM.java
import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Multimap;
class Foo
end
puts Foo.new
f = Foo.new
f.instance_eval do |e|
meta = class << e
@yawn
yawn / connection-quality.rb
Created February 23, 2011 11:52
To proxy or not to proxy, that's the question
class Connection
require 'net/http'
TEST_HOST = 'www.example.com'
TEST_PORT = 80
TEST_PATH = '/index.html'
# yields either one of the supplied proxy or :unrestricted (no proxy) or :restricted (nothing worked)
def self.quality? *proxies
unzip -o \*.jar -x META-INF/*; rm *.jar