Skip to content

Instantly share code, notes, and snippets.

View kthy's full-sized avatar
🧀
Was wird aus dem Loch wenn der Käs gefressen ist?

Kristian Thy kthy

🧀
Was wird aus dem Loch wenn der Käs gefressen ist?
View GitHub Profile
@kthy
kthy / pinboard.md
Last active January 17, 2022 15:21
📌 The Pinboard
@kthy
kthy / pipenv.stdout
Last active June 13, 2019 20:36
pipenv.stdout
S:\private\my-repo>pipenv install -e git+https://github.com/kivy-garden/garden.git@3c6a9374e397123a483e655d818f313c8f3ee640#egg=kivy-garden
Installing -e git+https://github.com/kivy-garden/garden.git@3c6a9374e397123a483e655d818f313c8f3ee640#egg=kivy-garden…
[== ]… Installing...
Installation Succeeded
Pipfile.lock (636acf) out of date, updating to (fcc6b3)…
Locking [dev-packages] dependencies…
Success!
Locking [packages] dependencies…
Success!
RESULTS:
@kthy
kthy / .vimrc
Last active October 26, 2018 11:35
Vim-8.0 config for WSL Ubuntu 18.04
set nocompatible
set expandtab
set tabstop=4
set shiftwidth=4
set smarttab
set nobackup
set nu!
set cursorline
set visualbell
@kthy
kthy / mac_to_label.sql
Created February 1, 2018 07:10
Converts a MAC address to a character string
CREATE OR ALTER FUNCTION dbo.CharLookup (@C AS NVARCHAR(max))
RETURNS NVARCHAR(max)
BEGIN
RETURN CASE
WHEN @C = '00' THEN NCHAR(0x0030)
WHEN @C = '01' THEN NCHAR(0x0031)
WHEN @C = '02' THEN NCHAR(0x0032)
WHEN @C = '03' THEN NCHAR(0x0033)
WHEN @C = '04' THEN NCHAR(0x0034)
WHEN @C = '05' THEN NCHAR(0x0035)
@kthy
kthy / postgis_snippets.sql
Last active June 13, 2019 20:38
PostGIS snippets
-- Fix table with wonky 4D geometries and SRID=0
ALTER TABLE krth.dagi_kommune
ALTER COLUMN geom TYPE geometry(MULTIPOLYGON, 25832)
USING ST_Force2D(ST_SetSRID(geom, 25832));
-- Alter geometry type on table
ALTER TABLE krth.clc_dk
ALTER COLUMN geom TYPE geometry(MULTIPOLYGON, 25832) USING ST_Force2D(ST_SetSRID(geom, 25832));
-- Materialized view with subset of data
@kthy
kthy / sensorthings.md
Last active September 4, 2017 08:46
SensorThings

A Datastream is a collection of Observations grouped by the same ObservedProperty and Sensor. An Observation is an event performed by a Sensor that produces a result whose value is an estimate of an ObservedProperty of the FeatureOfInterest.

[ref]

@kthy
kthy / sigfox_custom_grammar.md
Created September 1, 2017 12:28
SigFox custom grammar

Custom message type decoding grammar

The "custom format" grammar is as follows:

format = field_def [" " field_def]* ;
field_def = field_name ":" byte_index ":" type_def ;
field_name = (alpha | digit | "#" | "_")* ;
byte_index = [digit*] ;
type_def = bool_def | char_def | float_def | uint_def ;

bool_def = "bool:" ("0" | "1" | "2" | "3" | "4" | "5" | "6" | "7") ;