Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="en">
<head>
<!--
inspired by Mozilla Webauthn documentation: https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API
copyright: 2019 Nicolas Mora <nicolas@babelouest.org>
license: MIT
-->
<title>Hmac-Secret webauthn Extension</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/cbor-js-unofficial@0.1.0-a4/cbor.min.js"></script>
@mrnerdhair
mrnerdhair / xchainjs-api.ts
Created June 22, 2021 01:08
the current public api of xchainjs-lib, all in a single file for easy reference
import { BncClient } from '@binance-chain/javascript-sdk/lib/client'
import { CosmosSDKClient, RPCTxResult } from '@xchainjs/xchain-cosmos'
import { Asset, BaseAmount } from '@xchainjs/xchain-util'
import { Network, Address, Balance, TxHistoryParams, TxsPage, Tx, Fees, TxParams, TxHash, FeeOptionKey } from './types'
export type FeeRate = number
export type FeeRates = Record<FeeOptionKey, FeeRate>
export type FeesWithRates = { rates: FeeRates; fees: Fees }
@mrnerdhair
mrnerdhair / types.test.ts
Created March 15, 2021 18:48
Demonstrate issues raised in ForbesLindesay/funtypes#48
import { Object as Obj, Literal, Unknown, String as Str, Record as Rec, Result, Static, Runtype, InstanceOf, Never, Function as Func } from "funtypes";
[
{description: "as-is", fn: (rt: any) => rt},
{description: "without placeholders", fn: <T extends Runtype<unknown>>(rt: T) => {
return Unknown.withParser({
parse(value: any): Result<Static<T>> {
return (rt.test(value) ? {success: true, value} : rt.safeParse(value)) as Result<Static<T>>;
}
})
@mrnerdhair
mrnerdhair / wg-lla.sh
Created June 27, 2020 21:41
Calculates cryptographically-bound IPv6 Link-Local Addresses from WireGuard public keys.
#!/bin/bash -e
blake2s_mix() {
local A_NAME="$1"
local A="$2"
local B_NAME="$3"
local B="$4"
local C_NAME="$5"
local C="$6"
local D_NAME="$7"

Keybase proof

I hereby claim:

  • I am reidrankin on github.
  • I am reidrankin (https://keybase.io/reidrankin) on keybase.
  • I have a public key whose fingerprint is 6256 018A AF7A 18A8 9144 1936 1678 7F8F BFCA 47FC

To claim this, I am signing this object: