Skip to content

Instantly share code, notes, and snippets.

View jbenet's full-sized avatar

Juan Benet jbenet

View GitHub Profile
ipfscluster status
runtime/cgo: pthread_create failed: Resource temporarily unavailable
SIGABRT: abort
PC=0x7fc965b63cc9 m=0
goroutine 0 [idle]:
goroutine 1 [running]:
runtime.systemstack_switch()
/usr/local/go/src/runtime/asm_amd64.s:252 fp=0xc420022768 sp=0xc420022760
@jbenet
jbenet / keybase.md
Created December 16, 2016 12:45
keybase.md

Keybase proof

I hereby claim:

  • I am jbenet on github.
  • I am jbenet (https://keybase.io/jbenet) on keybase.
  • I have a public key ASAWhIGxMuoQ0o-F4ZnPOCvXlJsF8U6WHVZXt3juy9H_SAo

To claim this, I am signing this object:

@jbenet
jbenet / ipld.md
Last active November 29, 2016 04:22

Given this Data

{
  "a": "b",
  "c": [
    {},
    {
      "d": 111,
@jbenet
jbenet / tikz_tag.rb
Created April 10, 2014 00:15
TikZ Liquid Tag Block for Jekyll
require "open4"
module Jekyll
class TikzBlock < Liquid::Block
def parse(tokens)
@nodelist ||= []
@nodelist.clear
while token = tokens.shift
@jbenet
jbenet / how-to-get-a-speedtest.md
Last active September 13, 2016 21:15
How to get a speed test

What is a speed test?

When picking event spaces and hotels, our group (which includes lots of engineers) requires a good internet connection. For that, we need to check the ping time, the download/upload speeds and capacities, the ISP, and more. This information is required for us to make a good decision, as we cannot get work done if the internet is not of high enough quality.

How to get a speed test?

  • Go to http://speedtest.net
  • Click "Begin Test"
  • Once the test is done, click "Share This Result"
  • Copy the link, and paste it to an email back to us.
'use strict'
const crypto = require('crypto')
const multihashing = require('multihashing')
// do not use cryptographic hash functions with pht
// use non-cryptographic fast hashes, like murmur3 or xxhash
const nextPowerOf2For = (n) => {
return Math.ceil(Math.log2(n))
}
@jbenet
jbenet / imports.json
Last active May 25, 2016 03:18 — forked from mbostock/.block
[{"name":"reflect","size":1000,"imports":["math","runtime","strconv","sync","unsafe"]}
,{"name":"crypto/x509/pkix","size":1000,"imports":["encoding/asn1","math/big","time"]}
,{"name":"unicode/utf8","size":1000}
,{"name":"encoding/asn1","size":1000,"imports":["bytes","errors","fmt","io","math/big","reflect","strconv","strings","time","unicode/utf8"]}
,{"name":"fmt","size":1000,"imports":["errors","io","math","os","reflect","strconv","sync","unicode/utf8"]}
,{"name":"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore","size":1000,"imports":["errors","github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go-uuid/uuid","log","path","strings"]}
,{"name":"github.com/jbenet/go-ipfs/crypto/internal/pb","size":1000,"imports":["github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/gogoprotobuf/proto","math"]}
,{"name":"crypto/elliptic","size":1000,"imports":["io","math/big","sync"]}
,{"name":"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.crypto/
@jbenet
jbenet / bar
Last active December 31, 2015 08:19
foo
hotfix
@jbenet
jbenet / pyhash.py
Last active December 22, 2015 16:58
pyhash -- quickly hash some text with md5, sha1, or sha256. Works with piping input.
#!/usr/bin/env python2.7
#
# Install this in your PATH as `pyhash`.
#
# curl https://gist.github.com/jbenet/6502583/raw/pyhash.py -o pyhash
# mv pyhash /usr/bin/local/pyhash
# chmod +x /usr/bin/local/pyhash
#
# If you want more cryptographic hashing functions, try the PassLib module.
#
@jbenet
jbenet / extends.coffee
Last active December 10, 2015 18:18
coffeescript's `__extends`
__extends = function(child, parent) {
# copy over all class properties
for (var key in parent) {
if (__hasProp.call(parent, key))
child[key] = parent[key];
}
# new constructor function
function ctor() {
# link back to child class