Skip to content

Instantly share code, notes, and snippets.


Eric Scrivner etscrivner

Block or report user

Report or block etscrivner

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
etscrivner / signal_v_noise.rb
Created Jan 24, 2017
Why choosing good metrics is important.
View signal_v_noise.rb
require 'csv'
def percent_support_tickets(time)
1.0 - ((time + 5) / 200.0)
seed = Random.new_seed
prng =
puts "Seed: #{seed}"
etscrivner / EIP150ReplaySafeSplit.sol
Last active Jan 29, 2017
Safe splitting contract that accounts for EIP-150 and ETH/ETC hard forks.
View EIP150ReplaySafeSplit.sol
pragma solidity ^0.4.2;
contract EIP150ReplaySafeSplit {
// Fork oracle for EIP-150 fork
AmIOnEIP150Fork amIOnEIP150Fork = AmIOnEIP150Fork(/* To be deployed */);
// Fork oracle for ETH/ETC fork
AmIOnTheFork amIOnDAOFork = AmIOnTheFork(0x2bd2326c993dfaef84f696526064ff22eba5b362);
// This routine provides a way to route funds across Ethereum chain forks. It preserves
// the signature of split method from DAO hard-fork replay split contract. If the current
etscrivner / AmIOnEIP150Fork.sol
Last active Oct 18, 2016
EIP-150 fork oracle.
View AmIOnEIP150Fork.sol
pragma solidity ^0.4.2;
contract AmIOnEIP150Fork {
// Tracks whether or not hard fork is effective on this chain.
bool public forked = false;
// Event emitted on updates during fork window to indicate status.
event ForkedStatus(bool forked);
// This function should be called between block X and Y.
function update() {
etscrivner / EIP150ForkConstant.sol
Last active Oct 17, 2016
Solidity contract used to determine the constant that should be used in EIP-150 fork oracle.
View EIP150ForkConstant.sol
pragma solidity ^0.4.2;
contract EIP150ForkConstant {
// Used to determine gas constant
event GasConstant(uint first, uint second, uint third);
event OnFork(bool forked);
// This function should be called between block X and Y.
function run() {
uint beforeGas = 0;

Keybase proof

I hereby claim:

  • I am etscrivner on github.
  • I am escrivner ( on keybase.
  • I have a public key whose fingerprint is 74A8 F331 A8B7 C5D8 0879 52B4 5A2E 7AA7 837C C233

To claim this, I am signing this object:

etscrivner / trinums.hoon
Created Jul 10, 2016
Hoon for producing triangular/tetrahedral numbers.
View trinums.hoon
|= number/@
=/ curnum 1
|- ^- (list @)
?: (gth curnum number) ~
:_ $(curnum (add 1 curnum))
=< (roll (triangular curnum) add)
++ iota
|= {start/@ end/@}
=/ count start
import csv
import math
from lib import statistics
from lib import integration
def get_data(csv_file):
with open(csv_file, 'r') as table:
reader = csv.DictReader(table)
etscrivner /
Created Feb 25, 2016
basestring.title is funky
>>> "62nd".title()
>>> "West 62nd st.".title()
"West 62Nd St."
etscrivner /
Created Dec 15, 2015
Simple JSON Benchmarking For Python
# -*- coding: utf-8 -*-
JSON encoding benchmark
import datetime
import itertools
etscrivner / facebook-sdk-test-failures.txt
Created Nov 17, 2015
Failing unit-tests from facebook-sdk when @unittest.skip decorator is removed.
View facebook-sdk-test-failures.txt
ERROR: test_valid_versions (__main__.TestAPIVersion)
Traceback (most recent call last):
File "/home/eric/Code/python/facebook-sdk/test/", line 101, in test_valid_versions
self.assertEqual(str(graph.get_version()), version)
File "facebook/", line 213, in get_version
raise self.create_exception_for_error(response)
GraphAPIError: An active access token must be used to query information about the current user.
You can’t perform that action at this time.