Skip to content

Instantly share code, notes, and snippets.

View thehowl's full-sized avatar
🧙‍♂️
cooking scrambled eggs on my cpu

Morgan thehowl

🧙‍♂️
cooking scrambled eggs on my cpu
View GitHub Profile

Privileged Imports

package main

import (
	rwboards "@gno.land/demo/boards"
	rboards "gno.land/demo/boards"
	ravl "gno.land/demo/avl"
)
@thehowl
thehowl / std.go
Last active November 7, 2024 17:35 — forked from moul/std.go
std.gno
// just reorganizing the current `std` into "categories", not yet improving the API.
// chain
type AddressList []Address
func NewAddressList() *AddressList
type RawAddress [RawAddressSize]byte
const RawAddressSize = 20
type Address string
func DerivePkgAddr(pkgPath string) Address
func EncodeBech32(prefix string, bz [20]byte) Address
package config // r/sys/config
type Key string
// keep in sync with tm2/pkg/params
// (can be checked with CI)
const (
Validators Key = "validators"
AllowedTokens Key = "allowed_tokens"
)
//go:build ignore
package main
import (
"fmt"
"go/doc"
"go/parser"
"go/token"
"io/fs"
$ go test -v -run 'Testdata/1588' .
=== RUN TestTestdata
=== RUN TestTestdata/issue-1588
testscript.go:534: WORK=$WORK
PATH=/usr/lib/go/bin:/home/howl/bin:/home/howl/go/bin:/home/howl/.yarn/bin:/home/howl/.npm-packages/bin:/home/howl/go/bin:/home/howl/.yarn/bin:/home/howl/.npm-packages/bin:/home/howl/.asdf/shims:/home/howl/.local/share/asdf/bin:/home/howl/bin:/home/howl/go/bin:/home/howl/.yarn/bin:/home/howl/.npm-packages/bin:/home/howl/.cargo/bin:/home/howl/.nvm/versions/node/v16.18.0/bin:/home/howl/go/bin:/home/howl/.yarn/bin:/home/howl/.npm-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/howl/py/bin:/home/howl/py/bin
GOTRACEBACK=system
HOME=/no-home
TMPDIR=$WORK/.tmp
devnull=/dev/null
/=/
@thehowl
thehowl / trace.go
Last active January 15, 2024 21:59
a utility function to print compact stacktraces - https://go.dev/play/p/cAyTUqy1p_I
/* Sample output:
prog.go:11 main.main
proc.go:250 runtime.main
asm_amd64.s:1598 runtime.goexit
*/
package main
import (
"fmt"
@thehowl
thehowl / unfollow-all.js
Created February 11, 2022 11:23
Script to unfollow people from last.fm when you have recovered your account after 5 years and in the meantime a followbot had taken over.
Array.from(document.querySelectorAll(".user-list-inner-wrap")).filter(x => x.querySelector(".user-follow") === null).forEach(x => x.querySelector('.follower-btn-following').click())
@thehowl
thehowl / generate-smart-certificate.sh
Last active July 17, 2023 20:41
The following scripts can aid in the creation of JWKs and server certificates for SMART Health Cards.
#!/usr/bin/env bash
# Small script to create a certificate authority to be used for SMART Health Cards.
# The script accepts an argument, which is the name of your organisation (ie. "ACME Ltd")
# The script will generate a data subdirectory in $PWD, the relevant files for
# the implementation of SMART Health Cards are issuer.key8 and chain.
# SUBJECT_ALT_NAME should be adjusted accordingly.
set -e
set -u
set -o pipefail
@thehowl
thehowl / tool
Last active May 7, 2020 16:52
probably the only good build tool
#!/bin/bash
# provides documentation for the sub-commands.
DOCUMENTATION=(
'help [COMMAND]'
"returns help for the specified command, or for all commands if none is specified.
$ ./tool help
$ ./tool help up"
'dev [COMMAND]'
@thehowl
thehowl / go-crosscompile-all
Created December 19, 2018 10:12
uncomplicated crosscompilation of the major 9 platforms in go
#!/usr/bin/bash
# Looking at the source, I see.
# Bear with me. I can barely understand bash, let alone writing it.
# See that something can be done in a much better way? Just Pull Request It (tm)
if [ -z ${1+x} ]; then nproj=${PWD##*/}; else nproj=$1; fi
echo project name $nproj
for GOOS in darwin linux windows; do
for GOARCH in 386 amd64; do
echo "Building $GOOS-$GOARCH"
if [ $GOOS == "windows" ]; then extension=".exe"; else extension=""; fi