Skip to content

Instantly share code, notes, and snippets.

@emeraldsanto
emeraldsanto / swagger-to-express.ts
Last active April 28, 2022 20:43
Define routes according to the Open API / Swagger specification and get a fully typed express resolver.
// === Parameter definition ===
interface RouteParameterBase {
description?: string;
nullable?: boolean;
required?: boolean;
}
interface BooleanRouteParameter extends RouteParameterBase {
type: 'boolean';
Alice's log(sends bitcoins to Bob)
========================================================================================================================
...
2019-10-21 12:38:20.476 [DBG] PEER: Sending Ping to 02d933bf399aadf537f78a48aa3d25a80fd87c3d0a861d7e35ffbcd06523313cf9@172.19.0.3:9735
2019-10-21 12:38:20.479 [DBG] PEER: Received Pong from 02d933bf399aadf537f78a48aa3d25a80fd87c3d0a861d7e35ffbcd06523313cf9@172.19.0.3:9735
2019-10-21 12:38:26.713 [DBG] CRTR: Found route: probability=0.6, hops=1, fee=0 mSAT
2019-10-21 12:38:26.740 [DBG] CRTR: Payment 83e1c34af5ea9b3f840f5c5d0f18985ff9f81958cd2c92fd2c62910c030ce032 (pid=1) successfully sent to switch
2019-10-21 12:38:26.740 [DBG] HSWC: ChannelLink(401:1:0) Queueing keystone of ADD open circuit: (Chan ID=0:0:0, HTLC ID=1)->(Chan ID=401:1:0, HTLC ID=0)
2019-10-21 12:38:26.741 [DBG] PEER: Sending UpdateAddHTLC(chan_id=3918d9d451fccc282250508991109007deecb6cafa73b6df9360a2bd589ec7c2, id=0, amt=10000000 mSAT, expiry=600, hash=83e1c34af5ea9b3f840f5c5d0f18985ff9
@marcedwards
marcedwards / loadingspinner.pde
Created May 30, 2018 02:25
A loading spinner with 6 dots
// A loading spinner with 6 dots.
// By @marcedwards from @bjango.
//
// Pretty messy and hacked together, but it works. ¯\_(ツ)_/¯
// Created using Processing 3.3.7.
float scaler = 0.24 * 4; // Scale the entire design.
float scalerb = 4; // Scale the entire design more.
int frame = 0;
@rhiaro
rhiaro / inbox.php
Created August 13, 2017 13:50
Basic LDN receiver. Help yourself. See: https://rhiaro.co.uk/2017/08/diy-ldn
<?
/*
Copyright 2017 Amy Guy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0