Skip to content
View excerpt.go
// Print the formatted error and exit.
func Fatalf(format string, a ...interface{}) {
fmt.Fprintf(os.Stderr, format, a...)
os.Exit(1)
}
View gist:d6e4ad3f64d5b2501b45
Three spams From: Dixon Fiske <dixon@boundary.com>
Hey Will,
Last try. Hope you get a chance to check it out.
Thanks,
Dixon
View gist:b6a0e4eacaca268d9163
One route: /some/more/comlplex/route
Requesting: /
BenchmarkBoneMux 3000000 466 ns/op
BenchmarkZeusMux 5000000 369 ns/op
BenchmarkHttpRouterMux 5000000 341 ns/op
BenchmarkNetHttpMux 2000000 616 ns/op
BenchmarkGorillaMux 2000000 625 ns/op
BenchmarkGorillaPatMux 2000000 776 ns/op
View _form.html.erb
<div class="field sweet_honey_for_bots">
<%= label_tag :sweet_honey, "This is a honeypot, if you see this your CSS is turned off or you're a bot. If you're not a bot don't fill it in." %>
<%= text_field_tag :sweet_honey %>
</div>
View flip_flop.rb
require "minitest/unit"
require 'minitest/autorun'
def calculate(str)
acc = state = 0
op = "+"
str.scan(/(?:.+?\b)/) do |atom|
if (state = 1 - state) == 1 # number state
acc = acc.send(op, Integer(atom))
else # op state
View huh.rb
[2.1.2] ~ $ irb
2.1.2 :001 > require 'tmpdir'; puts "foo"; Dir.tmpdir { |dir| puts "bar" }
foo
=> "/var/folders/r7/kjzbwmx533b20hcf1_s9kc9c0000gn/T"
View tankdrive.js
// Tankdrive function, that converts the x and y values
// to store as left/right
function tankdrive(x, y) {
// first Compute the angle in deg
// First hypotenuse
var z = Math.sqrt(x*x + y*y);
// angle in radians
rad = Math.acos(Math.abs(x)/z);
// and in degrees
View gist:14c51363acb189b17963
Please make suggestions to @will_j on twitter
- Additions
- Removals
- Ordering
- etc.
Rules:
- 90's Dance or house in the style of what's already on the list
View iam.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1397834652000",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": [
Something went wrong with that request. Please try again.