Skip to content

Instantly share code, notes, and snippets.

@careo
careo / README.md
Last active August 29, 2015 13:55 — forked from mbostock/.block
int main() {
int dollars, cents;
float paid = 4.00f;
float price = 3.10f;
int paidInt = paid * 100;
int priceInt = price * 100;
int changeInt = paidInt - priceInt;
@careo
careo / stats.rb
Created October 8, 2009 06:23 — forked from tmm1/stats.rb
require 'socket'
require 'rubygems'
require 'collectd/pkt'
class Stats
def initialize name, instance, opts = {}
@name, @instance = name, instance
@sock = UDPSocket.new
@sock.connect opts[:host] || '239.192.74.66',
# $Id: dns_cache.rb 5040 2007-10-05 17:31:04Z francis $
#
#
require 'rubygems'
require 'eventmachine'
require 'resolv'
module EventMachine

EventMachine Notes

Adapted to Markdown format from rom Aman Gupta's gist at: http://gist.github.com/79224

Using:

require 'rubygems'
require 'eventmachine'

EM::run Takes over the Process

@careo
careo / snippet.rb
Created February 18, 2009 21:38 — forked from anonymous/snippet.rb
require 'benchmark'
require 'rubygems'
require 'rest_client'
Benchmark.bm(25) do |x|
etag = nil
x.report("(freshen view, fetch etag)") do
resp = RestClient.get "localhost:5984/gateway-development/_view/Image/all?include_docs=true&reduce=false"