Skip to content

Instantly share code, notes, and snippets.

@tgerring
tgerring / MessageController.js
Created May 27, 2014 13:01
sails/express/node bridge to cpp-ethereum json rpc
/**
* MessageController
*
* @module :: Controller
* @description :: A set of functions called `actions`.
*
* Actions contain code telling Sails how to respond to a certain type of request.
* (i.e. do stuff, then send some JSON, show an HTML page, or redirect to another URL)
*
@tgerring
tgerring / gulpfile.js
Created June 28, 2014 09:32
gulp with livereload
var gulp = require('gulp'),
gutil = require('gulp-util'),
es = require('event-stream');
var plugins = require('gulp-load-plugins')({
camelize: true
});
var config = require('./gulpfile.config');
@tgerring
tgerring / gulp.config.js
Created June 28, 2014 09:33
gulp config
var GLOBSTAR = '**/*';
var basePaths = {
src: 'src/',
dest: 'build/'
};
var typeMap = {
// templates
Verifying myself: My Bitcoin username is +taylorg. https://onename.io/taylorg
@tgerring
tgerring / mitchjackbet.py
Last active August 29, 2015 14:05
Mitch Jack bet Serpent
init:
contract.storage["Mitch"] = 0xf4b7cc7faa866a2275972317598e7d936cfc9adc
contract.storage["Jack"] = 0x52c5535efae9bd86e04c627aa5c716a392358c5e
code:
BTC = msg.data[0]
if (msg.sender == contract.storage["Mitch"] or msg.sender == contract.storage["Jack"]):
if block.timestamp > 1449187200:
if BTC > 2000:
send(contract.storage["Mitch"], contract.balance, (tx.gas - 100))
else:
@tgerring
tgerring / multisig.md
Created October 11, 2014 21:03
pybtctool multisig instructions

Init. Note the result of each step for use in signing transactions

  1. pybtctool random_key # generate private key DO NOT SHARE
  2. pybtctool privtopub # generate pubkey
  3. everyone share and record pubkeys here

  4. pybtctool mk_multisig_script # generate multisig script
  5. pybtctool scriptaddr # generate multisig address

Create transaction

  1. pybtctool preparetx | pybtctool -s setup_coinvault_tx # create transaction
@tgerring
tgerring / ipfs-guide-mac.md
Last active February 24, 2022 13:20
IPFS Mac Guide

IPFS Guide

Mac Installation

  1. Install Homebrew
  2. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Install prerequisites
  4. brew install git hg
  5. brew install osxfuse (see Mac issues to troubleshoot common errors)
  6. Install Go
@tgerring
tgerring / goethereumqt54.sh
Last active August 29, 2015 14:14
Mist installation for Ubuntu Trusty with Go 1.4.1 and QT 5.4
# set environment variables
export PATH=$HOME/golang/bin:$PATH
export GOPATH=$HOME/go
mkdir -p $GOPATH
# install base dependencies
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y git mercurial build-essential software-properties-common pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev mesa-common-dev libglu1-mesa-dev
@tgerring
tgerring / mistquickinstall.sh
Last active August 29, 2015 14:14
Mist install Ubuntu 14.04
# install dependencies
sudo add-apt-repository ppa:beineri/opt-qt54-trusty -y
sudo apt-get update
sudo apt-get install -y git mercurial build-essential software-properties-common golang pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev mesa-common-dev libglu1-mesa-dev qt54quickcontrols qt54webengine
# set environment variables
echo 'export PKG_CONFIG_PATH=/opt/qt54/lib/pkgconfig' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/opt/qt54/lib' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
source ~/.bashrc
@tgerring
tgerring / mist-develop.sh
Last active April 13, 2018 07:19
Mist installation script for Ubuntu 14.04.2
#!/bin/bash
# Install base dependencies
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y git mercurial build-essential software-properties-common pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev
# Install Qt 5.4.1 packages (only required for Mist)
sudo add-apt-repository ppa:beineri/opt-qt541-trusty -y
sudo apt-get update