Skip to content

Instantly share code, notes, and snippets.

View codahale's full-sized avatar
🦆
Look at all these chickens

Coda Hale codahale

🦆
Look at all these chickens
View GitHub Profile
@codahale
codahale / blah.go
Created June 16, 2014 00:27
Only you can prevent race conditions.
package blah
import (
"sync/atomic"
)
var (
n uint64
)
5.0 +
|
|
| +-----*-----+
|
4.0 +
|
|
| +-----*-----+
14:17:33 ~ $ rustc --version
rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800)
14:17:36 ~ $ cargo --version
cargo 0.0.1-pre-nightly (8c01b6b 2015-01-08 20:52:43 +0000)
14:17:47 ~ $ cd /tmp
14:17:49 /tmp $ cargo new --bin hello-world
14:18:00 /tmp $ cd hello-world/
/tmp/hello-world
14:18:04 /tmp/hello-world [git:master?] $ cargo run
An unknown error occurred
### Keybase proof
I hereby claim:
* I am codahale on github.
* I am codahale (https://keybase.io/codahale) on keybase.
* I have a public key whose fingerprint is 5D14 B50E 62D6 279D 6C41 52DC DC59 AFA3 840C 3C96
To claim this, I am signing this object:
@codahale
codahale / gist:41459
Created December 30, 2008 00:45 — forked from damon/gist:41453
def whack(objects)
return Hash[*objects.map{ |o| [o.send("table_name"), o.send("delete_all")] }.flatten]
end
#!/usr/bin/env ruby
# Written by Coda Hale <coda.hale@gmail.com>. MIT License. Go for it.
def include_pattern(filename)
core = filename.gsub(/_spec/, "").gsub(/\Aspec\//, "")
return Regexp.quote(core)
end
if ARGV.empty? || ARGV == ["--help"] || ARGV == ["-h"]
STDERR.puts("Usage:")
--- LastFM - Ban Current Track
set previousApp to name of (info for (path to frontmost application))
tell application "Last.fm" to activate
tell application "System Events" to keystroke "b" using command down
open location "x-launchbar:hide"
tell application previousApp to activate
# coda@lunchbox /L/R/G/1/specifications> less jsonpretty-1.0.0.gemspec
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{jsonpretty}
s.version = "1.0.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Nick Sieger"]
s.date = %q{2009-02-19}
#!/usr/bin/env ruby
$existing_methods = []
def print_methods(library)
new_methods = [].methods.sort - $existing_methods
for method in new_methods
puts "Array##{method}"
end
puts "(total: #{new_methods.size} added by #{library})\n\n"
@Path("/hello")
@Produces(MimeType.TEXT_PLAIN)
public class HelloResource {
@GET
public Response sayHello(@DefaultValue("stranger") @QueryParam("name") String name) {
return Response.ok("Hello, " + name).build();
}
}