Skip to content

Instantly share code, notes, and snippets.

@robfig
robfig / keybase.md
Created January 16, 2023 21:45
keybase.md

Keybase proof

I hereby claim:

  • I am robfig on github.
  • I am robfig (https://keybase.io/robfig) on keybase.
  • I have a public key whose fingerprint is B8D7 6647 DBE9 3A03 9E5F 92E3 8018 674F 7E67 DBDA

To claim this, I am signing this object:

function f() {
var c = [];
$(".js-donut-graph").each(function(g, e) {
var b = $(e);
e = {a:e, b:parseInt(b.css("width")), g:parseInt(b.data("score")), c:parseInt(b.data("avgScore")), canvas:void 0};
c.push(e);
b = h(e.b, e);
$(e.a).append(b);
e.canvas = b;
});
@robfig
robfig / find.go
Created April 11, 2015 16:20
gobench Find Words
// Package bench is a package which contains
// programs of Go Benchmark Competition.
package bench
import (
"bufio"
"bytes"
"errors"
"fmt"
"os"
@robfig
robfig / ooo.go
Last active August 29, 2015 14:12
OOO
package main
import (
"fmt"
"io/ioutil"
"sort"
"strings"
"time"
"github.com/laurent22/ical-go"
@robfig
robfig / gist:e9d1b3a4cd23270be63c
Created October 20, 2014 20:11
robfig fedemo
<html>
<body>
<style>
body {
width: 900px;
margin: auto;
font-family: helvetica;
}
p {
@robfig
robfig / gocomplete.sh
Last active August 29, 2015 14:05
bash autocompletion for Go packages
#!/bin/sh
#
# Bash completion script for the go commandline tool. Presently it activates
# to show packages under $GOPATH on these subcommands:
# - go install
# - go build
# - go test
#
# Install by sourcing this file from your .bash_profile, or copy it in.
#
bitbucket.org/tebeka/selenium 02df1758050f
code.google.com/p/cascadia 4f03c71bc42b
code.google.com/p/go-uuid 7dda39b2e7d5
code.google.com/p/go.exp b6cb26fb5e26
code.google.com/p/go.net bc411e2ac33f
code.google.com/p/go.text d7d53b6d3df8
code.google.com/p/goauth2 5877582f0cb0
code.google.com/p/gogoprotobuf dc9b8350fb4568b6562900df872672f378242552
code.google.com/p/goprotobuf 48b0cac3bc4a
code.google.com/p/log4go c3294304d93f
@robfig
robfig / gist:7554760
Created November 19, 2013 23:51
go1.2rc5 autobench on raspberry pi Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux
hg clone https://code.google.com/p/go /home/pi/autobench/work/go
requesting all changes
adding changesets
adding manifests
adding file changes
added 18484 changesets with 63793 changes to 8344 files (+7 heads)
updating to branch default
3818 files updated, 0 files merged, 0 files removed, 0 files unresolved
hg clone -r go1.1.2 /home/pi/autobench/work/go /home/pi/autobench/work/go1.1.2
adding changesets
@robfig
robfig / gist:6355285
Created August 27, 2013 15:45
Autobench results on a Mac Pro - OSX 10.8.2 - 2.8 GHz 4-core Xeon - 16 GB 1066 MHz DDR3
/Users/robfig/autobench/work/go.tip/bin/go test -bench=. bench/go1 > /Users/robfig/autobench/work/go1-tip.txt
testing: warning: no tests to run
/Users/robfig/autobench/work/go.11/misc/benchcmp /Users/robfig/autobench/work/go1-11.txt /Users/robfig/autobench/work/go1-tip.txt
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17 6685798102 5448294853 -18.51%
BenchmarkFannkuch11 4472978544 4454452974 -0.41%
BenchmarkFmtFprintfEmpty 108 154 +42.59%
BenchmarkFmtFprintfString 376 344 -8.51%
BenchmarkFmtFprintfInt 245 283 +15.51%
BenchmarkFmtFprintfIntInt 371 468 +26.15%
@robfig
robfig / .emacs
Last active June 13, 2023 16:08
Emacs integration with goimports - https://github.com/bradfitz/goimports. Every time you save your Go code, 1. Add missing imports (standard library only), 2. Remove unnecessary imports, 3. Go fmt
;; OSX - Update the PATH to match that from the shell
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell
(replace-regexp-in-string "[[:space:]\n]*$" ""
(shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(when (equal system-type 'darwin) (set-exec-path-from-shell-PATH))
;; Go mode