Skip to content

Instantly share code, notes, and snippets.

Jacob H. Haven jacobhaven

Block or report user

Report or block jacobhaven

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jacobhaven
jacobhaven / country_paths.py
Created Apr 3, 2019
Searching the graph of country land borders.
View country_paths.py
from collections import defaultdict
#
# What are the minimum number of land border crossing between any two countries?
# Based on this reddit question: https://redd.it/b8vjzp
#
# From https://www.cia.gov/library/publications/resources/the-world-factbook/fields/281.html
countries = {
"Afghanistan": {"China", "Iran", "Pakistan", "Tajikistan", "Turkmenistan", "Uzbekistan"},
@jacobhaven
jacobhaven / set.c
Created Jan 27, 2018
Simple set implementation in C
View set.c
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
#include <stdio.h>
struct list {
int elem;
struct list *next;
};
@jacobhaven
jacobhaven / client.go
Last active Aug 8, 2016
Bleichenbacher '06
View client.go
package main
import (
"crypto/sha1"
"encoding/hex"
"flag"
"fmt"
"io/ioutil"
"log"
"math/big"
View GoSublime.sublime-settings
{
"fmt_cmd": ["goimports"],
"comp_lint_enabled": true,
"on_save": [{
"cmd": "gs9o_open", "args": {
"run": ["sh",
"go build . errors && go test -i && go test && go vet && golint ."],
"focus_view": false
}}],
"autocomplete_closures": true,
@jacobhaven
jacobhaven / playground.go
Created Mar 28, 2016
Go Playground run script
View playground.go
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"net/url"
"os"
View keybase.md

Keybase proof

I hereby claim:

  • I am jacobhaven on github.
  • I am jacob_haven (https://keybase.io/jacob_haven) on keybase.
  • I have a public key whose fingerprint is EE14 F126 17B1 A8DB 6900 40FC 65DC 372E 63C0 7F33

To claim this, I am signing this object:

View test_simplehttp.go
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
)
@jacobhaven
jacobhaven / 1024bit_roots.go
Created Mar 4, 2015
Root CAs with Weak Public Keys
View 1024bit_roots.go
package main
import (
"crypto/rsa"
"crypto/x509"
"encoding/asn1"
"fmt"
"io/ioutil"
"log"
"net/http"
@jacobhaven
jacobhaven / keybase.md
Created Dec 7, 2014
Keybase.io proof of account ownership
View keybase.md

Keybase proof

I hereby claim:

  • I am jacobhaven on github.
  • I am jacob_haven (https://keybase.io/jacob_haven) on keybase.
  • I have a public key whose fingerprint is 8618 6C79 9241 1037 563D 686B 4810 468B 1E34 0F56

To claim this, I am signing this object:

@jacobhaven
jacobhaven / frequencycount.go
Created Oct 21, 2014
Go UTF8 Frequency Analysis Tool
View frequencycount.go
package main
import (
"bytes"
"flag"
"fmt"
"io"
"log"
"net/http"
)
You can’t perform that action at this time.