Skip to content

Instantly share code, notes, and snippets.


Rick Companje companje

View GitHub Profile
companje / ocr
Created April 25, 2023 11:59
ocr mac
View ocr
import config,json,os,subprocess,ocr2json
from tqdm import tqdm
from joblib import Parallel, delayed
import Quartz,Vision
from Cocoa import NSURL
from Foundation import NSDictionary
from wurlitzer import pipes # needed to capture system-level stderr
companje / load-link-filter.js
Created October 26, 2022 07:27
load, link and filter data in javascript from triplestore
View load-link-filter.js
companje / Understanding-City-in-a-bottle.pde
Last active October 2, 2022 19:27
Understanding 'City in a bottle' in Processing
View Understanding-City-in-a-bottle.pde
//Original by Frank Force (KilledByAPixel) -
//Observable by Daniel Darabos -
//Processing version by Rick Companje as intermediate step to 8086 assembly language.
//this version currently lacks textures on the buildings. To be continued.
int w=72;
int h=50;
int t=0;
void setup() {
companje / data.ttl
Created August 16, 2022 11:28
geof:sfWithin (filter results with a boundingbox) with SPARQL
View data.ttl
@prefix geo: <> .
@prefix def: <> .
@prefix hua: <> .
a def:Adresvermelding ;
geo:asWKT "POINT (9.1825624999999995 45.4652869999999965)"^^geo:wktLiteral .
companje / Mercury-Elevation-map-waterlevel.pde
Created August 11, 2022 14:21
Mercury Elevation map waterlevels /
View Mercury-Elevation-map-waterlevel.pde
//based on Mercury MESSENGER Global DEM 665m v2
PImage palette, heightmap, colormap, normalmap;
PShader shader;
float progress = 0;
void setup() {
size(2048, 1024, P3D);
shader = loadShader("shader.glsl");
companje /
Last active August 8, 2022 21:57
Expression Parser - Bauer-Samelson algorithm as described in BYTE magazine 1976-02
# Expression Parser - Bauer-Samelson algorithm as described in BYTE magazine 1976-02
# Python implementation: Rick Companje, 30 July 2022
# usage: main("20+4*(5-(6-3))/8")
import math,re
def precedence_check(operators,c):
if not operators or operators[-1] == '(':
return True
companje / straatnamen.geojson
Created June 21, 2022 12:19
View straatnamen.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
companje /
Created June 15, 2022 15:16
Fuzzy matchen in strings
#!/usr/bin/env python3
import json
from fuzzysearch import find_near_matches
from fuzzywuzzy import process
json_file = "A152153-pagina5tm20/page/NL-UtHUA_A152153_000005-f.json"
def fuzzy_extract(qs, ls, threshold):
'''fuzzy matches 'qs' in 'ls' and returns list of
companje /
Last active June 14, 2022 10:17
#!/usr/bin/env python3
import csv,os
from collections import defaultdict
rows = [ row for row in csv.DictReader(open("kadaster.csv")) ]
# "id","gemeente","arrondissement","dvd_nr","dvd_code","soort","leggerart","begin","eind","begino","eindo","invnr","reeksdeel","Sectie","pad","filenaam","naam1","naam2"
file_paths = defaultdict(list)
companje / Conway Game of Life.pde
Last active June 8, 2022 23:47
Conway Game of Life - 321 bytes in Processing - Code Golf submission
View Conway Game of Life.pde
Rick Companje, 2022-06-09, MIT
Code Golf submission: Shortest Game of Life
289 bytes in Processing/Java
grid 100x100
grid wraps around
draw custom pattern with mouse