Skip to content

Instantly share code, notes, and snippets.

View redsquirrel's full-sized avatar
🐿️

Dave Hoover redsquirrel

🐿️
  • Flexa, Inc.
  • Evanston, IL
  • 03:28 (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:
@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
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; } }';
a = [1,2,3,4,4]
def mode(a)
h = {()} # what are these parentheses?
a.length.times do |i|
# Code block?
end
end
# some Ruby code here
def method_being_worked_on
# awesome code
end
@redsquirrel
redsquirrel / setup.md
Last active December 12, 2015 12:09
Laptop setup for Fundamentals of Web Development: a day with Dev Bootcamp Chicago

Do you have Ruby installed?

Do you have SQLite installed?