Skip to content

Instantly share code, notes, and snippets.

View jmhodges's full-sized avatar
🐶
return of the

Jeff Hodges jmhodges

🐶
return of the
View GitHub Profile
@jmhodges
jmhodges / dogs.go
Last active December 17, 2015 16:30
demo hour code. written quickly.
package main
import (
"io"
"log"
"math/rand"
"net/http"
"os"
)
@jmhodges
jmhodges / output
Created November 12, 2015 22:51
copyfighter github.com/letsencrypt/boulder/...
# receiver should be made into a pointer
func (revocationCodes).Len() int
# receiver should be made into a pointer
func (revocationCodes).Less(i int, j int) bool
# receiver should be made into a pointer
func (revocationCodes).Swap(i int, j int)
# return value 'certChecker' at index 0 should be made into a pointer
package comeatme
import (
"code.google.com/p/google-api-go-client/plus/v1"
"net/http"
)
type SimpleKeyTransport struct {
Key string
Transport http.RoundTripper
@jmhodges
jmhodges / 3_commits
Created June 22, 2012 19:10
first three commits in the go repo
changeset: 3:172d32922e72
user: Brian Kernighan <bwk@research.att.com>
date: Fri Apr 01 02:03:04 1988 -0500
summary: last-minute fix: convert to ANSI C
diff -r ac3363d7e788 -r 172d32922e72 src/pkg/debug/macho/testdata/hello.c
--- a/src/pkg/debug/macho/testdata/hello.c Fri Apr 01 02:02:04 1988 -0500
+++ b/src/pkg/debug/macho/testdata/hello.c Fri Apr 01 02:03:04 1988 -0500
@@ -1,6 +1,8 @@
#include <stdio.h>
@jmhodges
jmhodges / hah
Created January 27, 2011 02:34
imagemagick is hilarious
[jhodges@thehost ~]$ identify -list resource
File Area Memory Map Disk Thread Time
-------------------------------------------------------------------------------
24576 50.551GB 35.309GiB 94.158GiB 18.446744EB 16 unlimited
@jmhodges
jmhodges / useless_phrases.txt
Created January 16, 2011 11:28
A nice start to a tool to help me write better
trying to
attempting to
to help
that helps
utilize
helps to
@jmhodges
jmhodges / kmp.go
Created October 15, 2010 05:14
The Knuth–Morris–Pratt string searching algorithm
package main
import (
"flag"
"fmt"
"os"
)
func makeTable(word string) ([]int) {
table := make([]int, len(word))
#include <ruby.h>
#include <node.h>
int main(int argc, char **argv) {
ruby_init();
ruby_script("embedded");
// The bizness
rb_thread_t th = ALLOC(struct rb_thread); \
th->last_status = 0;
if !defined?(JSON)
require 'yajl'
else
require 'json'
module Yajl
LOOKUP = %w[null boolean string bytes int long float double].
inject({}){|h,k| h[k.inspect] = k; h }
def self.dump(obj)
JSON.dump(obj)
end
package main
import (
"fmt"
"time"
)
// SlowShepherd is for making sure that a func used in a tight loop
// does not cause a thundering herd problem. If the function
// thunderingHerdFunc returns quicker than the sleepInterval given,