Skip to content

Instantly share code, notes, and snippets.

View iamwilhelm's full-sized avatar

Wil Chung iamwilhelm

  • Mountain View, CA
View GitHub Profile
@iamwilhelm
iamwilhelm / balancing_node_sizes.thy
Created January 22, 2024 02:33
Incomplete proof of balancing node sizes after insert
theory balancing
imports Main
begin
type_synonym nodesizes = "nat list"
fun insert :: "nodesizes ⇒ nat ⇒ nodesizes" where
"insert [] _ = []" |
"insert (x#xs) 0 = (x+1)#xs" |
"insert (x#xs) n = x # insert xs (n-1)"
@iamwilhelm
iamwilhelm / lattice_merkle_tree.thy
Created January 22, 2024 02:29
Incomplete and in-progress proof of merge function for a unicit balanced Merkel Tree using join-semilattices
theory lattice_merkle_tree
imports Main
begin
fun opt_last :: "'a list ⇒ 'a option" where
"opt_last [] = None" |
"opt_last xs = Some (last xs)"
(****** Lattice Merke Tree ******)
// tic tac toe
import * as readline from "readline";
enum Turn {
Player = "player",
Computer = "computer",
}
type Piece = string;
import * as fs from "fs/promises";
import Knex from "knex";
const Web3 = require("web3");
import { Refract, Component, Fiber } from "./refract";
/******* custom hooks ******/
export const useFetchJson = filePath => {
let [json, setJson] = Refract.useState("useFetchJson", null);
import Web3 from "web3";
import Knex from "knex";
import {
loadTokenList,
marketContract,
borrowAndSupplyRate,
rateToApy
} from "./compound.js";
import { subscribeNewBlocks } from "../libs/eth.js";
@iamwilhelm
iamwilhelm / ingest_using_hooks.ts
Last active August 3, 2021 22:18
Demo on ingesting data from an API using a hooks-like API
import * as config from "../config";
import { Refract, elem } from "./refract";
import {
useFetchJson,
useWeb3,
useCompoundContract,
useBlockHeader,
useBorrowAndSupplyRate,
useKnex,

Keybase proof

I hereby claim:

  • I am iamwilhelm on github.
  • I am iamwil (https://keybase.io/iamwil) on keybase.
  • I have a public key ASBfzjxITKzh-jyx-blESRdAagfInX3t1ibMrmtWPUWhnwo

To claim this, I am signing this object:

@iamwilhelm
iamwilhelm / snippet.html
Created January 26, 2018 20:01
coinbase snippet
<div>
<a class="donate-with-crypto" href="https://commerce.coinbase.com/products/4dff420e-6055-46fe-9747-dd12b708c873">
<span>Donate with Crypto</span>
</a>
<script src="https://commerce.coinbase.com/v1/checkout.js"></script>
</div>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamwilhelm
iamwilhelm / contacts.csv
Last active March 31, 2017 01:51
Some sample csv addresses
first_name last_name company_name address city county state zip phone1 phone2 email web
James Butt Benton, John B Jr 6649 N Blue Gum St New Orleans Orleans LA 70116 504-621-8927 504-845-1427 jbutt@gmail.com http://www.bentonjohnbjr.com
Josephine Darakjy Chanay, Jeffrey A Esq 4 B Blue Ridge Blvd Brighton Livingston MI 48116 810-292-9388 810-374-9840 josephine_darakjy@darakjy.org http://www.chanayjeffreyaesq.com
Art Venere Chemel, James L Cpa 8 W Cerritos Ave #54 Bridgeport Gloucester NJ 08014 856-636-8749 856-264-4130 art@venere.org http://www.chemeljameslcpa.com
Lenna Paprocki Feltz Printing Service 639 Main St Anchorage Anchorage AK 99501 907-385-4412 907-921-2010 lpaprocki@hotmail.com http://www.feltzprintingservice.com
Donette Foller Printing Dimensions 34 Center St Hamilton Butler OH 45011 513-570-1893 513-549-4561 donette.foller@cox.net http://www.printingdimensions.com