Skip to content

Instantly share code, notes, and snippets.

View lukechampine's full-sized avatar

Luke Champine lukechampine

View GitHub Profile
@lukechampine
lukechampine / vanity.go
Created January 2, 2024 16:04
Vanity Go import server
package main
import (
"flag"
"html/template"
"log"
"net/http"
"strings"
)
@lukechampine
lukechampine / dead-arms.txt
Created October 26, 2023 22:39
Dead Hoon linter
Dead arms detected by running the above script on urbit/urbit tip, against a corpus
of ~300k lines of Hoon (including urbit/urbit itself and various community repos):
urbit/pkg/autoprop/sur/sole.hoon:
+sole-gen
urbit/pkg/autoprop/lib/ethereum.hoon:
+address-to-checksum
+batch-read-request
+encode-atoms
+light-json-request
@lukechampine
lukechampine / bnt.go
Last active October 2, 2023 03:22
BNT renderer
package main
import (
"fmt"
)
func main() {
fmt.Println(renderBNT(19))
}
@lukechampine
lukechampine / fractran.hoon
Created May 13, 2020 05:08
A FRACTRAN interpreter in Hoon
|= n=@
=<
|^
(fib-dec (interp fib-prog (fib-enc n)))
++ fib-prog
:~ 17^65
133^34
17^19
23^17
2.233^69
@lukechampine
lukechampine / fac.hoon
Last active August 24, 2024 20:11
Evolution of a Hoon Programmer
:: Hoonlet
::
|= n=@
?: =(n 0)
1
(mul n $(n (dec n)))
::
:: Commie Hoontard
:: (...daydreaming of his very own Type 59...)
::
# ssh config to connect to a host via local network if available.
#
# For example, if the host is 192.168.1.10 on your local network,
# first run ssh-keyscan 192.168.1.10 to see what keys are available,
# then substitute that key for your_host_key (-t selects the key type).
Match exec "ssh-keyscan -T 1 -t ed25519 local.ip.for.host 2>/dev/null | grep -F your_host_key" host yourhostname
Hostname local.ip.for.host
Port 22
@lukechampine
lukechampine / monads.c
Last active November 21, 2024 00:37
Maybe and Either Monads in C
#include <stdio.h>
#include <stdbool.h>
// Maybe
typedef struct MaybeInt {
int just;
bool nothing;
} MaybeInt;
@lukechampine
lukechampine / fuzzseed.go
Created January 31, 2018 00:34
Find the one word missing from a seed
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"github.com/NebulousLabs/Sia/modules"
@lukechampine
lukechampine / cold.go
Created October 4, 2017 16:05
Cold wallet address generator
package main
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
"github.com/NebulousLabs/Sia/crypto"
[alias]
au = add -u .
c = commit -m
ca = commit --amend
can = commit --amend --no-edit
cf = commit --fixup
co = checkout
cob = checkout -b
com = checkout master
cp = cherry-pick