Skip to content

Instantly share code, notes, and snippets.

View anacrolix's full-sized avatar
🚀
Factorio

Matt Joiner anacrolix

🚀
Factorio
View GitHub Profile

Prelude cleanup issues

  1. Either class has ok/err backwards for Result — The impl Either (Result e a) maps ok to the Ok case and err to Err, but either conventionally takes the left/error handler first: either : (a -> c) -> (b -> c) -> Either a b -> c -- ^left ^right
  2. Your Result impl has either ok err which reads as "ok handler first, err handler second" — but in walk line 78 you write either (each ...) (readDirErr path) where the first arg handles the Ok case (the list of names). So the naming is internally consistent with your usage, but reversed from the Haskell convention where the left/error case comes first.
  3. Either class signature — either : (a -> c) -> (b -> c) -> c is missing Self — it should probably be either : (a -> c) -> (b ->

How to use the snapshot reset tool:

erigon snapshots reset

See the options:

   --chain value                  name of the network to join
   --datadir value                Data directory for the databases (default: /Users/anacrolix/Library/Erigon)
 --help, -h show help
#!/usr/bin/env bash
set -eu
declare -A dict
dict=(
["linux/amd64"]="linux-amd64"
["linux/arm64"]="linux-arm64"
["linux/arm/v7"]="linux-arm"
@anacrolix
anacrolix / tibiavia.md
Last active May 30, 2024 07:56
medivia vs tibia

things tibia got right:

  • the music and sounds are actually really good
  • auto loot.
  • getting rid of bags in monsters
  • fixing the bag spam in public places
  • updating some of the older areas, especially the towns like edron.
  • stacked runes. omfg
  • distance weapon progression
  • monster level hunt progression
local kwargs = {}
for i, k in ipairs(KEYS) do
kwargs[k] = table.remove(ARGV, 1)
end
local pop_kwargs = function (name, required)
local value = kwargs[name]
if value == nil then
if required then
error(string.format("missing key %q", name))
Netherlands 93.158.213.92 udp://tracker.opentrackr.org:1337/announce
Netherlands 93.158.213.92 http://tracker.opentrackr.org:1337/announce
France Roubaix 151.80.120.115 udp://9.rarbg.com:2810/announce
France Roubaix 151.80.120.112 udp://9.rarbg.com:2810/announce
France Roubaix 151.80.120.114 udp://9.rarbg.com:2810/announce
France Roubaix 151.80.120.113 udp://9.rarbg.com:2810/announce
United Kingdom 45.154.253.5 udp://tracker.openbittorrent.com:6969/announce
United Kingdom 45.154.253.6 udp://tracker.openbittorrent.com:6969/announce
United Kingdom 45.154.253.4 udp://tracker.openbittorrent.com:6969/announce
United Kingdom 45.154.253.7 udp://tracker.openbittorrent.com:6969/announce
@anacrolix
anacrolix / fuck.sh
Last active March 22, 2022 07:58
Removing stolon keeper from Fly.io postgres-ha
fly ssh console -a <postgres app>
export $(cat /data/.env | xargs)
stolonctl removekeeper <keeper id>
anacrolix@anacrolix-mbp-2018:~/src/replica-haskell$ cabal v2-repl
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: replica-haskell-0.1.0.0 (user goal)
[__1] next goal: base (dependency of replica-haskell)
[__1] rejecting: base-4.14.1.0/installed-4.14.1.0, base-4.15.0.0,
base-4.14.1.0, base-4.14.0.0 (constraint from project config TODO requires
==4.13.0.0)
[__1] rejecting: base-4.13.0.0 (constraint from non-upgradeable package
requires installed instance)
async def sendto(self, bytes, addr):
try:
await self.socket.sendto(
bytes, addr,
)
finally:
exc_value = sys.exc_info()[1]
if exc_value is not None:
exc_value = str(exc_value)
with self.db_conn: