Skip to content

Instantly share code, notes, and snippets.

View leetrout's full-sized avatar
🎸

Lee Trout leetrout

🎸
View GitHub Profile
@leetrout
leetrout / all-the-way-downify.sh
Created April 20, 2023 17:41 — forked from lafentres/all-the-way-downify.sh
:*-all-the-way-down: Slack emoji creator, based off alisdair/intensify.sh
#!/bin/bash
# Credit to https://gist.github.com/alisdair/ffc7c884ee36ac132131f37e3803a1fe for the excellent original
# script that this one is based on. This script modifies the original to create the all-the-way-down effect.
# Generate a `:*-all-the-way-down:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
@leetrout
leetrout / jumboify.sh
Created April 20, 2023 17:41 — forked from lafentres/jumboify.sh
Jumbo Slack emoji creator, based off alisdair/intensify.sh
#!/bin/bash
# Credit to https://gist.github.com/alisdair/ffc7c884ee36ac132131f37e3803a1fe for the excellent original
# script that this one is based on. This script modifies the original to create the jumbo.
# Generate a jumbo Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
@leetrout
leetrout / debug.js
Created February 26, 2023 04:58
Minecraft WorldEdit debug script
/**
* Small helper script to debug via printing in WorldEdit CraftScript.
* Save this file as debug.js in your WorldEdit config folder:
* e.g. config/worldedit/craftscript/debug.js
*
* Use in the console:
* /cs debug
* /cs debug player
*
* With no arguments this script will print all globals.
@leetrout
leetrout / partyify.sh
Created July 15, 2022 12:49 — forked from lafentres/partyify.sh
:something-party: Slack emoji creator, based off alisdair/intensify.sh
#!/bin/bash
# Generate a `:something-party:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
if [ $# -eq 0 ]; then
echo "Usage: $0 input.png"
exit 1
@leetrout
leetrout / betteruptime.vcf
Last active May 10, 2022 17:28
BetterUptime contact card
BEGIN:VCARD
VERSION:3.0
FN;CHARSET=UTF-8:Better Uptime
N;CHARSET=UTF-8:Uptime;Better;;;
TEL;TYPE=CELL:+1 (872) 231-5748
TEL;TYPE=CELL:+1 (872) 278-6922
TEL;TYPE=CELL:+1 (872) 278-6921
TEL;TYPE=HOME,VOICE:+1 (256) 485-4958
TEL;TYPE=WORK,VOICE:+32 460 23 47 47
ORG;CHARSET=UTF-8:BetterUptime
@leetrout
leetrout / cloud-provider-migration.md
Created April 7, 2022 21:24
vidarh's cloud migration strategy

Originally from https://news.ycombinator.com/item?id=30945448 and I wanted a copy somewhere else:

Unfortunately not, but it's surprisingly straight-forward, apart from the database bit, but here's a bit more detail from memory. There are many ways of doing this and some will depend strongly on which tools you're comfortable with (e.g. nginx vs. haproxy vs. some other reverse proxy is largely down to which one you know best and/or already have in the mix) [Today I might have considered K8s, but this was before that was even a realistic option, but frankly even with K8s I'm not sure -- the setup in question was very simple to maintain]:

  • Set up haproxy, nginx or similar as reverse proxy and carefully decide if you can handle retries on failed queries. If you want true zero-downtime migration there's a challenge here in making sure you have a setup that lets you add and remove backends transparently. There are many ways of doing this of various complexity. I've tended to favour using dynamic dns updates for t
@leetrout
leetrout / since2010.md
Created March 3, 2022 16:18 — forked from shawwn/since2010.md
"What happened after 2010?"

This was a response to a Hacker News comment asking me what I've been up to since 2010. I'm posting it here since HN rejects it with "that comment is too long." I suppose that's fair, since this ended up being something of an autobiography.

--

What happened after 2010?

@leetrout
leetrout / example.md
Created August 5, 2020 20:26
Markdown Diffs

The current code looks like this:

type Demo struct {
  Field        int
  AnotherField string
}

We actually need to track the Thing

@leetrout
leetrout / main-profile.go
Created July 9, 2020 01:14
Quick drop in profiler snippet for Go
// Rename your main func to _main and drop this in
func main() {
f, err := os.Create("trace_" + time.Now().Format("20060102150405"))
if err != nil {
panic(err)
}
trace.Start(f)
_main()
trace.Stop()
f.Close()
@leetrout
leetrout / custom_game_engines_small_study.md
Created April 25, 2020 01:51 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) becaus