Skip to content

Instantly share code, notes, and snippets.

View cktricky's full-sized avatar
🏠
Working from home

Ken Johnson cktricky

🏠
Working from home
View GitHub Profile
@cktricky
cktricky / gist:4967248
Last active December 13, 2015 20:08
crappy solution for parsing sources from a string
require 'uri'
a = %{rubygems repository http://blahblah.net/, https://rubygems.org/}
b = a.split().inject([]) {|array, string|
begin
x = URI.parse(string).absolute?
array << string if x
rescue
end
require 'wXf/wXfui'
begin
require 'rubygems'
require 'celluloid'
rescue LoadError
end
module WXf
module WXfassists
@cktricky
cktricky / proc-it-like-its-hawt
Created September 30, 2012 01:33
Cool proc-ness
#!/usr/bin/env ruby
require 'celluloid'
require 'net/http'
class Fetcher
include Celluloid
def get(action, url)
puts "doing work.."
res = action.call(url)
@cktricky
cktricky / celluloid.rb
Created September 17, 2012 21:04
Celluloid Test
#!/usr/bin/env ruby
require 'celluloid'
require 'net/http'
class Fetcher
include Celluloid
def get(url)
puts "requesting url #{url}"
response = Net::HTTP.get URI(url)