I hereby claim:
- I am seoh on github.
- I am seoh (https://keybase.io/seoh) on keybase.
- I have a public key whose fingerprint is 3F6B 402B C421 9BD0 D5AE 3C27 8DFA C8F5 E0E6 BA93
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// https://www.cs.nott.ac.uk/~gmh/monparsing.pdf | |
// | |
// type Parser[T] = String -> [(T, String)] | |
// | |
/** lookahead token | |
* | |
* Parser -> Parser |
/** | |
* so many type of chaining | |
*/ | |
//// about dot-indentation. | |
// type 1-1. align with dot. | |
const ret = obj.method1() | |
.method2() | |
.method3() | |
.value(); |
const prefixes = (prev, next) => prev ? `${prev}[${next}]` : next | |
const serialize = (key, value, prefix = '') => { | |
switch(value.constructor.name) { | |
case "Array": return value.map((obj, i) => serialize(i+ "", obj, prefixes(prefix, key))).join('&') | |
case "Object": return parse(value, prefixes(prefix, key)) | |
default: return prefixes(prefix, key) + '=' + value | |
} | |
} |
There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a fish pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.
brew install ffmpeg
apt install ffmpeg
call plug#begin('~/.vim/plugged') | |
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align | |
Plug 'junegunn/vim-easy-align' | |
Plug 'junegunn/seoul256.vim' | |
Plug 'junegunn/goyo.vim' | |
Plug '/usr/local/opt/fzf' | |
Plug 'junegunn/fzf.vim' |
// from https://etherworld.co/2017/11/17/understanding-the-concept-of-private-key-public-key-and-address-in-ethereum-blockchain/ | |
const EC = require('elliptic').ec | |
const BN = require('bn.js') | |
const ec = new EC('secp256k1') | |
const keccak256 = require('js-sha3').keccak256 | |
const G = ec.g | |
const privateKey = process.argv[2] | |
const pk = new BN(privateKey) |
object Main extends App { | |
// boilerplate | |
import scala.reflect.runtime.universe._ | |
def show[T](value: T)(implicit tag: TypeTag[T]) | |
= tag.toString.replace("Main.", "") | |
// type-level programming |