Skip to content

Instantly share code, notes, and snippets.

View danrobinson's full-sized avatar

Daniel Robinson danrobinson

  • San Francisco, CA
View GitHub Profile
@danrobinson
danrobinson / WhiteHat.sol
Last active August 28, 2020 16:40
White Hat contract
pragma solidity ^0.6.5;
interface IGetter {
function set(bool) external;
}
interface IPool {
function burn(address to) external returns (uint amount0, uint amount1);
}
@danrobinson
danrobinson / hashes.txt
Last active July 16, 2022 21:46
Bitcoin block hashes up to block 477635
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048
000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd
0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449
000000004ebadb55ee9096c9a2f8880e09da59c0d68b1c228da88e48844a1485
000000009b7262315dbf071787ad3656097b892abffd1f95a1a022f896f533fc
000000003031a0e73735690c5a1ff2a4be82553b2a12b776fbd3a215dc8f778d
0000000071966c2b1d065fd446b1e485b2c9d9594acd2007ccbd5441cfc89444
00000000408c48f847aa786c2268fc3e6ec2af68e8468a34a28c61b7f1de0dc6
000000008d9dc510f23c2657fc4f67bea30078cc05a90eb89e84cc475c080805
@danrobinson
danrobinson / htlc.ts
Created March 30, 2018 19:06
HLTC on Stellar
const HtlcSequenceNumber = Ratchet1SequenceNumber.plus(3)
const htlcAmount = 50
const aliceOldBalance = 250
const bobOldBalance = 750
const HtlcTime = moment().unix()
const HtlcTimeout = HtlcTime + TIMEOUT_CLAIM

Keybase proof

I hereby claim:

  • I am danrobinson on github.
  • I am danrobinson (https://keybase.io/danrobinson) on keybase.
  • I have a public key whose fingerprint is 62FC 4579 7E6C DAAB 7A73 5727 BE25 3B00 A0AA 4310

To claim this, I am signing this object:

// Database server in Node.js
var http = require('http'),
url = require('url');
// global variable to store key-value pairs
var storage = {}
// handler for requests to /set
var set = function(request, response) {
@danrobinson
danrobinson / gist:5253663
Last active October 15, 2020 13:47
Docker daemon won't stop and doesn't echo hello world
root@ip-10-111-55-205:/home/ubuntu# CONTAINER_ID=$(docker run -d busybox /bin/sh -c "while true; do echo hello world; sleep 1; done")
2013/03/27 11:53:10 docker run -d busybox /bin/sh -c while true; do echo hello world; sleep 1; done
root@ip-10-111-55-205:/home/ubuntu# docker logs $CONTAINER_ID
2013/03/27 11:53:20 docker logs a4e97e86e8ddb2cdfeac38ae88c12bcff91233f268a637ac5f170c53c27bb476
root@ip-10-111-55-205:/home/ubuntu# docker ps
2013/03/27 11:54:11 docker ps
ID IMAGE COMMAND CREATED STATUS COMMENT
a4e97e86e8ddb2cdfeac38ae88c12bcff91233f268a637ac5f170c53c27bb476 busybox:latest /bin/sh -c while tru About a minute ago Up About a minute
....other containers from previous attempts....