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
//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 / cheatsheet.md
Created May 17, 2016 16:25
Go `testing` package cheatsheet

Basic file

Filename being [name]_test.go

package yourpackage

import (
	"testing"
)
@thehowl
thehowl / peppymessages.txt
Last active September 28, 2023 04:35
wank wank wank wank
+---------+----------+----------+---------------------+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | username | channel | moment | is_action | message |
+---------+----------+----------+---------------------+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 36582 | peppy | #osu | 2015-07-15 09:33:16 | 0 | !system restart tatoe |
| 37137 | peppy | #osu | 2015-07-15 09:38:09 |
@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
package main
import (
"testing"
"encoding/json"
"encoding/gob"
"bytes"
)
// initialisation
@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())
// ==UserScript==
// @name Slack stats unveiler
// @namespace http://howl.moe/
// @version 1.0
// @description There's not much to see on the stats slack page if you're not on a slack paid plan. Let's get around it, because you *can* see more stats even if you did not pay for them!
// @author Howl
// @match http*://*.slack.com/admin/stats
// @grant none
// @updateURL https://gist.github.com/TheHowl/bad883282a676cefbcb2/raw/slack-stats-unveiler.user.js
// ==/UserScript==
@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]'