Skip to content

Instantly share code, notes, and snippets.

@allartk
allartk / bbox.py
Last active December 1, 2025 09:08
Get wkt for bbox
-- NL, 28992 projection bounds as wgs84 https://epsg.io/28992
"POLYGON(({xmin} {ymin}, {xmin} {ymax}, {xmax} {ymax}, {xmax} {ymin}, {xmin} {ymin}))".format(xmin=3.2,ymin=50.75,xmax=7.22,ymax=53.7)
-- NL, 28992 projection bounds https://epsg.io/28992
"POLYGON(({xmin} {ymin}, {xmin} {ymax}, {xmax} {ymax}, {xmax} {ymin}, {xmin} {ymin}))".format(xmin=482,ymin=306602,xmax=284182,ymax=637049)
-- beetje extra buffer onder limburg
"POLYGON(({xmin} {ymin}, {xmin} {ymax}, {xmax} {ymax}, {xmax} {ymin}, {xmin} {ymin}))".format(xmin=482,ymin=280000,xmax=284182,ymax=637049)
@allartk
allartk / README.MD
Created November 14, 2025 14:55
Ptyxis background
@allartk
allartk / main.py
Last active November 28, 2024 11:17
Typer with progressbar and multiprocessing
import time
from multiprocessing import Pool
from rich.progress import Progress
import random
import typer
def worker(_: int) -> None:
time.sleep(random.randint(0, 5) / 10)
def main(processes: int = 4) -> None:
@allartk
allartk / commit-msg
Last active October 7, 2024 09:15 — forked from mathiasschopmans/commit-msg
Git commit hook using bash to validate the commit message against conventional commits
#!/usr/bin/env bash
# Credits: https://gist.github.com/mathiasschopmans/70e8d466c620d950f2ca2cea08c4e279#file-how-to-setup-git-commit-hook-for-conventional-commits-using-bash-md
# Get the commit message
commit_msg=$(cat "$1")
# Define a regex pattern to match the conventional commit message format
pattern='^((Merge|Revert) .*$|(api|break|new|feat|fix|docs|refactor|ci|chore|perf|style|test)(: |\(.{1,}\):).*)'
@allartk
allartk / formik-react-select-hoc.ts
Created July 11, 2022 07:27
Higher Order Component for Formik & react-select with typescript
import { OptionType } from '@helpers/interfaces';
import { FieldProps } from 'formik';
import { ComponentType } from 'react';
import { SingleValue } from 'react-select';
/**
* A higher order component to use react-select inside formik forms
* @param WrappedComponent
* @returns
*/
@allartk
allartk / 99_restart_sound
Last active August 28, 2022 09:35
B450-GAMING-PRO-CARBON-MAX-WIFI linux ubuntu 20.04
#!/bin/sh
case "$1" in
post)
DEVICE_ID=`lspci -D |grep 'HD Audio'|awk '{print $1}'`
echo 1 > /sys/bus/pci/devices/${DEVICE_ID}/remove
sleep 1
echo 1 > /sys/bus/pci/rescan
esac
@allartk
allartk / git-cleanup.sh
Last active March 28, 2022 14:05
Branch cleanup
#!/bin/bash
echo -e "Current branch: \e[1m$(git rev-parse --abbrev-ref HEAD) \e[0m"
BRANCHES=`git branch --merged | egrep -v "(^\*|master|main|dev)"`
echo "Do you want to remove the following merged branches?"
echo $BRANCHES
echo "Are you sure? (y/n)"
read -n 1 answer
@allartk
allartk / OSM.md
Last active May 8, 2019 12:44
Openstreetmap intro

Thuis in OSM land

We hebben een project om OSM te gaan hosten en een WMS service aan te bieden.

Dit project is gebasseerd op de mapserver basemaps (https://mapserver.org/basemaps/install.html). Dus om jullie kennis te maken met dit project gaan we proberen een WMS OSM op te zetten!

  • OSM data
  • Mapserver
  • Imposm3, data importeren