Skip to content

Instantly share code, notes, and snippets.

78d841612ec3cfa069040348a45bbb0eca7006cdc01ed4be18d51ee8c0fd07bf
d2fe25f0ecc567158923131f12ab10b370463cebace765a0f9bfc4b3e655b183
3120a3bef7c2d904d6742c375214594420e90f953d54d391ccaefdce5ae60910
/**
* Hashes signed by satoshi which do not appear on the blockchain.
* All of these hashes and signatures verify against satoshi's original public key of:
* 0411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3
*
* First TX in bitcoin history:
* https://blockchain.info/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16?show_adv=true
*
* The pubkey used to redeem the funds:
* https://blockchain.info/tx-index/14862/0
exports.normalize = function normalize(signature) {
var data, p, len, rlen, slen;
if (Buffer.isBuffer(signature))
signature = Array.prototype.slice.call(signature);
else if (typeof signature === 'string')
signature = utils.toArray(signature, 'hex');
data = signature.slice();
p = { place: 0 };
┌─ chjj@slickrick ~/work/node_modules/bcoin [wallet-bip45$]
└ $ git push origin wallet-bip45
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.38 KiB | 0 bytes/s, done.
Total 7 (delta 5), reused 0 (delta 0)
remote: /data/github/current/config/basic.rb:67:in `require': cannot load such file -- /data/github/current//data/github/current/vendor/ruby/b3255a8b572160bf249b5019c1ec93e667d547ee/lib/ruby/2.1.0/x86_64-linux/rbconfig.rb (LoadError)
remote: from /data/github/current/config/basic.rb:67:in `require'
remote: from /data/github/current/config/basic.rb:210:in `<top (required)>'
@chjj
chjj / view-pdf.sh
Created March 24, 2013 12:25
A terminal PDF viewer
#!/bin/sh
pandoc -t html -o - -f pdf "$1" | w3m -T text/html
Without code block:
* item
one
* item
two
* * *
paragraph
***
@chjj
chjj / gist:3229094
Created August 1, 2012 17:33
toUnderscore and toCamel functions
function toUnderscore(obj) {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
if (Array.isArray(obj)) {
return obj.forEach(toUnderscore);
}
Object.keys(obj).forEach(function (key) {
if (/[a-z][A-Z]/.test(key)) {
var k = key.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
@chjj
chjj / repl.js
Created July 7, 2012 03:07
curl node repl (possibly dangerous?)
var http = require('http');
var pty = require('pty.js');
var server = http.createServer(function(req, res) {
var ua = req.headers['user-agent'] || '';
if (!~ua.indexOf('curl/')) {
res.setHeader('Content-Type', 'text/plain');
return res.end('curl -sSNT. localhost:8000');
}
@chjj
chjj / gist:2695383
Created May 14, 2012 18:03
winston changelog

Winston Changelog

From v0.5.11 to query_stream.

  • Some transports have been altered in the way the log objects themselves are transported. Any code that relies on a log object's property names for a particular transport may need to be changed.
    commits:
    • 7bfd5b8483ad2f71ac8d3f350608b506dc0dc208
  • 979193c2ef2857d99dd2852c3d5432438a268b4d
terminal #2:
open("/dev/pts/8", O_RDWR|O_NOCTTY) = 8
ioctl(8, TIOCSWINSZ, {ws_row=30, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb735f738) = 851
close(8) = 0
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
mmap2(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0xb6a3a000
mprotect(0xb6a3a000, 4096, PROT_NONE) = 0
clone(child_stack=0xb6a7a484, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb6a7abd8, {entry_number:6, base_addr:0xb6a7ab70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb6a7abd8) = 852