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 / keybase.md
Created March 13, 2015 00:35
keybase.md

Keybase proof

I hereby claim:

  • I am jmhodges on github.
  • I am jmhodges (https://keybase.io/jmhodges) on keybase.
  • I have a public key whose fingerprint is 8A35 CDF5 3D9F 1A4C 189D 67F6 3A39 B99B 7493 8DA7

To claim this, I am signing this object:

@jmhodges
jmhodges / welp.scala
Last active August 29, 2015 13:56
The catch statement doesn't print the text. Seen with scala 2.8.1, 2.9.2 and now 2.10.x.
object Welp {
def foobar(a: Int, b: Int, c:Int) { throw new IllegalArgumentException }
def main(args: Array[String]) {
List(3) map {
try {
foobar(1, 2, _)
} catch {
case e: Throwable => { // This set of braces is optional. Problem remains when removed.
println("won't be printed")
$ twurl -U '/1.1/users/show.json?screen_name=jmhodges'
{"errors":[{"message":"SSL is required","code":92}]}
@jmhodges
jmhodges / gist:8273329
Created January 5, 2014 20:21
Amazon's TLS is sad. When given far better options by the client, it still uses TLS 1.0 and ancient ciphers.
$ # This DYLD_LIBRARY_PATH is because the default OS X 10.8 (and, I think, 10.9) still doesn't have
$ # a modern OpenSSL installation. You'll want `openssl version` to be 1.0.1e, at least.
$ DYLD_LIBRARY_PATH=/usr/local/ssl/lib:$DYLD_LIBRARY_PATH /usr/local/ssl/bin/openssl s_client -connect console.aws.amazon.com:443 < /dev/null 2>/dev/null | egrep '(Protocol|Cipher)\s+:'
Protocol : TLSv1
Cipher : RC4-MD5
$ # :( :( The same result for aws.amazon.com. Amazon.com still uses TLS 1.0 and RC4-SHA, too!
@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"
)
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))