Skip to content

Instantly share code, notes, and snippets.

Dave Hoover redsquirrel

Block or report user

Report or block redsquirrel

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
View BigFallback.sol
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 Mar 21, 2018
sample dependencies for Dave's usual truffle
View package.json
{
"name": "<PROJECT NAME>",
"version": "1.0.0",
"description": "",
"main": "truffle-config.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
View vote.sh
# Votes no to http://is.gd/pfPETu
curl -d '{"__submit":"Submit","__VIEWSTATEGENERATOR":"34F41AA2","DO_YOU_SUPPORT_THE_CURRENT_TAX":"ANTI TAX REFORM--No","__posted_cid":"quorum_lgraham-iq","__posted_crop":"19342.19239924.10215216.183192353","__posted_sid":"32", "__VIEWSTATE":"/wEPDwUKMTEzMDE2NDkyNw9kFgICAw9kFgICAQ8PFgIeBFRleHQF7Ak8aHRtbD4KICAgIDxoZWFkPgogICAgICAgIDx0aXRsZT48L3RpdGxlPgogICAgPC9oZWFkPgogICAgPGJvZHk+CiAgICAgICAgPHRhYmxlIGNsYXNzPSdzdXJ2ZXlib2R5ICcgIHdpZHRoPScxMDAlJyAgY2VsbHNwYWNpbmc9MCBjZWxscGFkZGluZz0wPjx0ciBjbGFzcz0ncmFkaW9fYWZmbCBhcnJfb3ZlcicgYmdjb2xvcj0nJz4NCjx0ZCB2YWxpZ249J3RvcCcgYWxpZ249J2xlZnQnIGNvbHNwYW49Mj4NCjxmb250IGlkPSdzZjAnIHN0eWxlPSdmb250LXNpemU6MTRweDsnPkRvIHlvdSBzdXBwb3J0IHRoZSBjdXJyZW50IHRheCByZWZvcm0gZWZmb3J0cyBiZWluZyBjb25zaWRlcmVkIGluIENvbmdyZXNzPzwvZm9udD48L3RkPjwvdHI+PHRyIGJnY29sb3I9JycgPjx0ZCB2YWxpZ249J3RvcCcgYWxpZ249J2xlZnQnIGNvbHNwYW49Mj48aW5wdXQgdHlwZT0ncmFkaW8nIGlkPSdxXzFfMCcgbmFtZT0nRE9fWU9VX1NVUFBPUlRfVEhFX0NVUlJFTlRfVEFYJyB2YWx1ZT0nUFJPIFRBWCBSRUZPUk0tLVllcycgPjxmb25
View keybase.md

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 Apr 23, 2016
problem deploying my solidity code to Ethereum
View compile-and-deploy.js
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 / install-bitcoin-classic-on-21.txt
Last active Mar 20, 2016
Installing and running Bitcoin Classic on a 21 device.
View install-bitcoin-classic-on-21.txt
# Note: I had previously been running a full (Satoshi) node after following this guide:
# https://21.co/learn/21-full-node/
# You should follow the steps in that guide before proceeding with this install.
wget https://github.com/bitcoinclassic/bitcoinclassic/archive/v0.12.0cl1.tar.gz
tar xvf v0.12.0cl1.tar.gz
cd bitcoinclassic-0.12.0cl1/
sudo apt-get install dh-autoreconf
sudo apt-get install pkg-config
@redsquirrel
redsquirrel / btc_transaction_firehose.rb
Last active Jun 5, 2017
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
View btc_transaction_firehose.rb
require 'rubygems'
require 'bitcoin'
require 'eventmachine'
require 'resolv'
require 'set'
module BitcoinTransactionReader
def initialize(ip_address, database)
@ip_address = ip_address
@database = database
View :(
> Date.today
=> Tue, 25 Aug 2015
> Time.at(Date.today.to_datetime.to_i).to_date
=> Mon, 24 Aug 2015
View gist:9778a9523317261349af
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 >
You can’t perform that action at this time.