Skip to content

Instantly share code, notes, and snippets.

@yusefnapora
yusefnapora / example.scala
Created March 22, 2016 22:07
Hashable marshalling
// The idea here is that case classes that extend `Hashable` will be converted to
// a Json AST using json4s, then written as canonical CBOR & hashed with SHA-256
//
// The actual hashing happens in `MultiHash.forHashable`, which can fail if the
// Json conversion fails.
//
// I don't think this custom marshaller trick will work for signatures, though,
// because it needs the signing key as an input, which wouldn't be available to
// the gremlin-scala marshaller.
//
#!/bin/bash
type jq >/dev/null 2>&1 || { echo >&2 "Please install jq: https://stedolan.github.io/jq/"; exit 1; }
type curl >/dev/null 2>&1 || { echo >&2 "Please install curl"; exit 1; }
if [ "$2" = "--local-ipfs" ] && (type ipfs >/dev/null 2>&1); then
USE_LOCAL_IPFS=1
else
USE_LOCAL_IPFS=0
fi
@yusefnapora
yusefnapora / onename.txt
Created November 30, 2015 15:10
onename verification
Verifying that +sefnap is my blockchain ID. https://onename.com/sefnap
@yusefnapora
yusefnapora / restart-xcode.sh
Created April 7, 2015 00:03
Restart Xcode script
#!/bin/bash
xcode_version="Xcode-beta"
killall Xcode 2> /dev/null
sleep 1
open "/Applications/$xcode_version.app"