Skip to content

Instantly share code, notes, and snippets.

View redsquirrel's full-sized avatar
🐿️

Dave Hoover redsquirrel

🐿️
  • Flexa, Inc.
  • Evanston, IL
  • 11:05 (UTC -05:00)
  • X @davehoover
View GitHub Profile
### Keybase proof
I hereby claim:
* I am redsquirrel on github.
* I am davehoover (https://keybase.io/davehoover) on keybase.
* I have a public key ASA1EHKSIhcT0FARgGjlGfd0YxaBOOijDZJyzZnpZByr6Ao
To claim this, I am signing this object:
pragma solidity ^0.4.21;
contract BigFallback {
event ReportGas(uint256 g);
function() public payable {
for (uint8 i = 0; i < 100; i++) {
emit ReportGas(gasleft());
}
@redsquirrel
redsquirrel / package.json
Created March 21, 2018 13:23
sample dependencies for Dave's usual truffle
{
"name": "<PROJECT NAME>",
"version": "1.0.0",
"description": "",
"main": "truffle-config.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"

Keybase proof

I hereby claim:

  • I am redsquirrel on github.
  • I am redsquirrel (https://keybase.io/redsquirrel) on keybase.
  • I have a public key whose fingerprint is B3E1 3036 39A4 61F1 EE0C 9798 5F56 6AFD 37E9 3769

To claim this, I am signing this object:

@redsquirrel
redsquirrel / compile-and-deploy.js
Created April 23, 2016 01:24
problem deploying my solidity code to Ethereum
var Web3 = require('../index.js'); // i'm running this from the example directory of web3
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://0.0.0.0:8545'));
web3.eth.defaultAccount = web3.eth.coinbase;
// var source = 'contract L { function f() returns (uint) { return 7; } }';
var source = 'contract L { function f() returns (uint); }'+
'contract X { L l; function X(L lib) { l = lib; } function y() returns (uint) { uint z = 46 + l.f(); return z; } }';
@redsquirrel
redsquirrel / btc_transaction_firehose.rb
Last active September 12, 2019 13:35
Streaming global Bitcoin transactions in less than 80 lines of Ruby code. Described at https://github.com/redsquirrel/jargon/blob/master/articles/btc-tx-streaming.md
require 'rubygems'
require 'bitcoin'
require 'eventmachine'
require 'resolv'
require 'set'
module BitcoinTransactionReader
def initialize(ip_address, database)
@ip_address = ip_address
@database = database
> Date.today
=> Tue, 25 Aug 2015
> Time.at(Date.today.to_datetime.to_i).to_date
=> Mon, 24 Aug 2015
redsquirrel:~ davehoover$ irb
2.0.0-p451 :001 > a = ['foo']
=> ["foo"]
2.0.0-p451 :002 > b = a
=> ["foo"]
2.0.0-p451 :003 > b += ['bar']
=> ["foo", "bar"]
2.0.0-p451 :004 > a
=> ["foo"]
2.0.0-p451 :005 >
@redsquirrel
redsquirrel / kyle-report.md
Last active August 29, 2015 14:17
Apprenticeship Program experience report

Hello Dave,

I wanted to thank you for the white paper you gave me when I reached out while starting our apprenticeship program at my company and share the results of the program with you. We took on 3 apprentices for our program and the program went really well and we've hired all 3 as full time developers.

We got to train 3 people in our processes and business, they all contributed to projects during the program and at the end we had 3 new hires that were ready to go day one, who we knew could perform since they had already been contributing and had been trained in everything we wanted them to know. We've had a hard time hiring people in the past and this just went so smoothly -- even the time investment wasn't as bad as I budgeted for, really early in the program they were able to contribute small units of work to the point that my time investment was recouped by the work they were contributing back.

The way we modeled the program wa