Skip to content

Instantly share code, notes, and snippets.

Mason Fischer masonforest

Block or report user

Report or block masonforest

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
masonforest / Dockerfile
Last active Oct 9, 2019
Test Drive Your Dockerfiles with RSpec and ServerSpec
View Dockerfile
FROM ubuntu:14.04
MAINTAINER Mason Fischer <>
RUN apt-get update && apt-get install -y nodejs
use crate::error;
use ellipticoin::{export, get_memory, sender, set_memory};
use wasm_rpc::Value;
use wasm_rpc::error::Error;
enum Namespace {
masonforest / deliver_email_matcher.rb
Created May 17, 2013
rspec matcher for ActionMailer rails email delivery
View deliver_email_matcher.rb
# Usage
# order = create(:order)
# expect {
# }.to deliver_email(OrderMailer, :paid,
masonforest / smart_contract.js
Last active Apr 13, 2019
A Javascript class for interacting with smart contracts written for the [Perlin network](
View smart_contract.js
const crypto = require('crypto');
const { StringDecoder } = require("string_decoder");
const fs = require("fs");
const util = require('util');
const writeFile = util.promisify(fs.writeFile);
const readFile = util.promisify(fs.readFile);
const fileExists = util.promisify(fs.exists);
const _ = require("lodash");
const TRANSACTION_ID = new Uint8Array(256);
const ALICE = new Uint8Array(256).fill(1);
masonforest /
Last active Apr 8, 2019
A simple tentative Ellipticoin Supply curve
import datetime
import time
# All monetary values are in Ellipticoin Base Units (one onethousandth of an Ellipticoin)
SECONDS_IN_A_YEAR = datetime.timedelta(days=365).total_seconds()
masonforest /
Last active Apr 6, 2019
Tentative Ellipticoin Supply Curve that works out to a supply of 21 million coins
import math
import datetime, time
import time
# This was chosen because it's an exponent of 2
# And it works out to about a year (1.3 years) if blocks are produced every 5 seconds as planned.
# This was chosen because it puts the final issuance sometime in 2031
# If Ellipticoin hasn't caught on by then assume we've failed :/
masonforest /
Last active Mar 29, 2019
Hashfactor is proof of work algorithm inspired by hashcash
# Hashfactor is proof of work algorithm inspired by [hashcash](
# Hashfactor is simpler to implement than hashcash but the result is not a
# hash with leading zeros. This tradeoff is worth-while if you have access to
# a computer to validate proof of work values but you'd like implementation to
# be simpler.
from random import randint
import binascii
import hashlib
masonforest / gist:99e7b694e68dfab06b348f22e179e370
Created Feb 25, 2019
./wavelet --port 3000 --db.path testdb_1 --api.port 9000
View gist:99e7b694e68dfab06b348f22e179e370
2019-02-25T14:33:44Z |INFO| Database has been loaded. db_path: testdb_1
2019-02-25T14:33:44Z |INFO| Successfully seeded the genesis of this node. file: genesis.json num_accounts: 1
2019-02-25T14:33:44Z |INFO| Registered transaction processor service. module: cloud.wasm
2019-02-25T14:33:44Z |INFO| Registered transaction processor service. module: contract.wasm
2019-02-25T14:33:44Z |INFO| Registered transaction processor service. module: money.wasm
2019-02-25T14:33:44Z |INFO| Registered transaction processor service. module: stake.wasm
2019-02-25T14:33:44Z |INFO| Keypair loaded. private_key: 6d6fe0c2bc913c0e3e497a0328841cf4979f932e01d2030ad21e649fca8d47fe71e6c9b83a7ef02bae6764991eefe53360a0a09be53887b2d3900d02c00a3858 public_key: 71e6c9b83a7ef02bae6764991eefe53360a0a09be53887b2d3900d02c00a3858
2019-02-25T14:33:44Z |INFO| Listening for peers. address=tcp://
2019-02-25T14:33:44Z |INFO| Local HTTP API is being served. host: localhost port: 9000
Enter a message: 2019-02-25T14:33:56Z |INFO| Connected t
masonforest / gist:4048732
Created Nov 9, 2012
Installing a Gem on Heroku from a Private GitHub Repo
View gist:4048732

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

View trace_ethereum_transaction.js
var fs = require('fs');
const createKeccakHash = require('keccak');
var jayson = require('jayson');
var transaction = "0x1066b9764832dc6dc710c3e131ee54c68c1b3f1e21de6b3dc8f97ee68ff3f190";
var client = jayson.client.http({
host: "",
port: 8545,
function hash(value) {
You can’t perform that action at this time.