Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
JoshCheek / what-is-an-object.txt
Last active January 1, 2016 02:18
Feynman talking about definitions of objects
Any simple idea is approximate; as an illustration, consider an object,
… what is an object? Philosophers are always saying, “Well, just take a chair for example.”
The moment they say that, you know that they do not know what they are talking about any more.
What is a chair? Well, a chair is a certain thing over there … certain?, how certain?
The atoms are evaporating from it from time to time—not many atoms,
but a few—dirt falls on it and gets dissolved in the paint;
so to define a chair precisely, to say exactly which atoms are chair,
and which atoms are air, or which atoms are dirt,
or which atoms are paint that belongs to the chair is impossible.
So the mass of a chair can be defined only approximately.
@icub3d
icub3d / main.go
Created July 29, 2013 23:46
First stab at groupcache.
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"github.com/golang/groupcache"
"io"
"net"
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active January 19, 2026 01:32
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@bgentry
bgentry / rated.go
Created October 11, 2012 23:48
Go token bucket rate limiter #golang
package main
import (
"fmt"
"time"
)
func main() {
ticker := rateLimit(4, 10)
@ryansmith3136
ryansmith3136 / instruments.rb
Created April 6, 2012 07:09
Sequel & Sinatra Instrumentation
module Instruments
def self.set_logger(l, m)
@logger = l
@method = m
end
def self.logger
@logger
end
@ryansmith3136
ryansmith3136 / memstat.rb
Created July 29, 2011 05:04
I am using this to profile my workers (queue_classic)
module Memstat
extend self
def puts
"memory=#{real_mem_size} ruby_objects=#{num_objects}"
end
def real_mem_size
mb = `ps -o rsz #{$$}`.split("\n")[1].to_f / 1024.0
mb = mb.round(-2) # nearest 100 (i.e. 60.round(-2) == 100)
// Handles JavaScript history management and callbacks. To use, register a
// regexp that matches the history hash with its corresponding callback.
window.HashHistory = {
// The interval at which the window location is polled.
URL_CHECK_INTERVAL : 500,
// We need to use an iFrame to save history if we're in an old version of IE.
USE_IFRAME : jQuery.browser.msie && jQuery.browser.version < 8,