Skip to content

Instantly share code, notes, and snippets.

View leonmvd's full-sized avatar

Leon leonmvd

  • University of Groningen
  • Groningen, Netherlands
View GitHub Profile
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active October 6, 2023 18:39
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@SzieberthAdam
SzieberthAdam / st_extend.sql
Created January 29, 2018 08:37
PostGIS function to extend a linestring
CREATE OR REPLACE FUNCTION st_extend (
geom geometry,
head_rate double precision,
head_constant double precision,
tail_rate double precision,
tail_constant double precision)
RETURNS geometry AS
$BODY$
-- Extends a linestring.
-- First segment get extended by length * head_rate + head_constant.
@a7madgamal
a7madgamal / dark.md
Last active July 14, 2023 04:00
Dark mode for Slack on MacOS
@balazsdukai
balazsdukai / objsplit.py
Last active February 9, 2024 14:22
Split an OBJ file into separate files per named object
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Split an OBJ file into separate files per named object
Ignores vertex texture coordinates, polygon groups, parameter space vertices.
The individual files are named as the object they contain. The material file
(.mtl) is not split with the objects.
Run: