Skip to content

Instantly share code, notes, and snippets.

const spawnCkcc = require('./src/utils/ckcc.js')
const spawnHwi = require('./src/utils/hwi.js')
spawnHwi(['--fingerprint=f25d9737', 'getxpub', "m/0"])
.then(r => console.log('hwi success', r))
.catch(e => console.log('hwi error', e))
spawnCkcc(['xpub', "m/0"])
.then(r => console.log('ckcc success', r))
.catch(e => console.log('ckcc error', e))
spawnHwi(['--fingerprint=f25d9737', 'getxpub', "m/0"])
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
```
$ npm run test
junction-web@1.0.0 test /home/justin/dev/junctionwallet/web
mocha --require ./test_init.js src/**/*.test.js
```
$ tree
.
├── index.json
├── opam
│   ├── astring.0.8.3
│   │   └── opam
│   ├── atd.2.0.0
│   │   └── opam
│   ├── atdgen.2.0.0
@justinmoon
justinmoon / one.js
Last active February 1, 2020 05:25
Electrum notes
// Prototype communicating to Electrum server backend
// Not currently used
const jayson = require('jayson/promise')
const bitcoin = require('bitcoinjs-lib')
const bip32 = require('bip32')
const testnet = bitcoin.networks.testnet
function getScriptHash(xpub, index) {
const {address} = bitcoin.payments.p2wpkh({
secret = open("secret.txt")
key = PrivateKey(secret)
tx = key.create_transaction([
("1Q2TWHE3GMdB6BZKafqwxXtWAWgFt5Jvm3", 1, 'btc'
])
broadcast(tx)
Traceback (most recent call last):
File "/home/justin/dev/mooniversity/app/server/venv/lib/python3.7/site-packages/urllib3/response.py", line 685, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/justin/dev/mooniversity/app/server/venv/lib/python3.7/site-packages/urllib3/response.py", line 425, in _error_catcher
yield
@justinmoon
justinmoon / _layout.js
Created January 2, 2020 04:15
Svelte animate on pageload (pulled directly from my project). Lines 45-46 and 50-52 are the important ones.
<style>
.background {
/* Set rules to fill background */
min-height: 100%;
/* Set up proportionate scaling */
width: 100%;
height: auto;
/* Set up positioning */
(function(){
    var box = function(){
        return box.fn.init();
    };

    box.prototype = box.fn = {
        init : function(){
            console.log('box.init()');
### Features
- Support Standard Markdown / CommonMark and GFM(GitHub Flavored Markdown);
- Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Code fold, Search replace, Read only, Themes, Multi-languages, L18n, HTML entities, Code syntax highlighting...;
- Markdown Extras : Support ToC (Table of Contents), Emoji, Task lists, @Links...;
- Compatible with all major browsers (IE8+), compatible Zepto.js and iPad;
- Support identification, interpretation, fliter of the HTML tags;
- Support TeX (LaTeX expressions, Based on KaTeX), Flowchart and Sequence Diagram of Markdown extended syntax;
- Support AMD/CMD (Require.js & Sea.js) Module Loader, and Custom/define editor plugins;