Skip to content

Instantly share code, notes, and snippets.

View GoodClover's full-sized avatar

olive GoodClover

View GitHub Profile
@GoodClover
GoodClover / envlist.lua
Created September 23, 2023 15:47
Change to a modifiable _ENV, whilst keeping access to existing environments.
local mkenvlist_mt = {
__index = function(self, index)
for _, env in ipairs(self._ENV_READ_LIST) do
local value = env[index]
if value != nil then
return value
end
end
return nil
end,
@GoodClover
GoodClover / OSM Changeset counter.py
Last active January 18, 2022 03:57
OSM changeset counter
from time import sleep
import io
import gzip
import requests
SITE = "https://planet.openstreetmap.org"
STATE_PATH = "/replication/changesets/state.yaml"
CHANGES_PATH = "/replication/changesets/"
LAST_RUN_KEY = "last_run: "
@GoodClover
GoodClover / 47.py
Created January 18, 2021 13:35
Stupid question for flipping 4 and 7
"stoopid"
def f_ternary(x: int) -> int:
return 4 if x == 7 else 7
def f_old_ternary(x: int) -> int:
return x == 4 and 7 or 4
@GoodClover
GoodClover / set_prompt.bat
Created November 14, 2020 23:50
Make the windows cmd prompt all colourful and pretty :)
@echo off
setx PROMPT %USERNAME%@%COMPUTERNAME%:$P$G
echo May require reload.