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 / 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") ;

@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 / 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 / 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 / .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 / 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 / pinboard.md
Last active January 17, 2022 15:21
📌 The Pinboard
@kthy
kthy / UnicodeData.csv
Last active February 1, 2022 15:17
UnicodeData.txt initial lines and field descriptions - full file at <http://www.unicode.org/Public/UNIDATA/UnicodeData.txt>
CodePoint CharacterName GeneralCategory CanonicalCombiningClasses BidirectionalCategory CharacterDecompositionMapping DecimalDigitValue DigitValue NumericValue Mirrored Unicode 1.0 Name ISO-10646CommentField UppercaseMapping LowercaseMapping TitlecaseMapping
0000 <control> Cc 0 BN N NULL
0001 <control> Cc 0 BN N START OF HEADING
0002 <control> Cc 0 BN N START OF TEXT
0003 <control> Cc 0 BN N END OF TEXT
0004 <control> Cc 0 BN N END OF TRANSMISSION
0005 <control> Cc 0 BN N ENQUIRY
0006 <control> Cc 0 BN N ACKNOWLEDGE
0007 <control> Cc 0 BN N BELL
0008 <control> Cc 0 BN N BACKSPACE
@kthy
kthy / banner.cmd
Created May 4, 2020 07:46
Display a string of text in extra large letters, similar to banner printing on a dot matrix printer.
@ECHO OFF&SETLOCAL
::
:: From https://ss64.com/nt/syntax-banner.html
::
IF [%1] NEQ [] goto s_start
ECHO Syntax
ECHO BANNER string
ECHO Where string is the text or numbers to be displayed
ECHO:
GOTO :eof
@kthy
kthy / vagrant.log
Last active May 6, 2020 09:10
Vagrant debug log for hashicorp/vagrant#11588
vagrant : INFO global: Vagrant version: 2.2.8
At line:1 char:1
+ vagrant up --debug 2>&1 | Tee-Object -FilePath ".\vagrant.log"
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( INFO global: Vagrant version: 2.2.8:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
INFO global: Ruby version: 2.6.6
INFO global: RubyGems version: 3.0.3