Skip to content

Instantly share code, notes, and snippets.


Florian von Bracht gitfvb

View GitHub Profile
gitfvb /
Last active Mar 23, 2021
Use json1 in SQLITE and DB Browser

When downloading the current (today: 2021-03-23) precompiled binaries or the cli of sqlite, the json extension is already compiled into the exe/dll

When you want to use it for db browser (which does not have the json1 extension right now), just download the precompiled binaries for windows from

Unzip it and replace the sqlite3.dll in C:\Program Files\DB Browser for SQLite

After re-opening DB Browser, you can execute queries like

SELECT JSON('{"a": "b"}')
gitfvb / random_strings.ps1
Last active Feb 1, 2021
random strings eg for vouchers
View random_strings.ps1
function getRandomString([int] $length) {
$random = [Random]::new()
$chars = @("0", "2", "3", "4", "5", "6", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")
$stringBuilder = ""
for ($i = 0; $i -lt $length; $i++) {
$stringBuilder += $chars[$random.Next($chars.Length)]
return $stringBuilder
gitfvb /
Created Jan 9, 2021
Playing minecraft 1.16.4 on local network LAN with one purchased game

Notebook #1

  • Open Minecraft normally
  • Go into a single player game
  • When in the gameplay, open the menu and open the game in the LAN
  • Note the port and maybe the IP

Notebook #2

  • Open the minecraft launcher so the current login tokens are getting refreshed
gitfvb / check-datatypes.ps1
Created Dec 22, 2020
Check some datatypes in PowerShell
View check-datatypes.ps1
Is-Numeric 10 # True
Is-Numeric "10" # True
Is-Numeric "10f" # False
Is-Numeric "+10" # True
Is-Numeric "-10" # True
Is-Numeric "-10.5" # False
function Is-Int ($value) {
gitfvb / splatting.ps1
Created Dec 16, 2020
splatting in powershell
View splatting.ps1
# this method allows a command execution with a hashtable instead of one big line
$restParams = @{
method = "Get"
uri = ""
ContentType = "application/json"
verbose = $true
Invoke-RestMethod @restParams # note the @ instead of the $
gitfvb / query.sql
Created Dec 9, 2020
db2 queries for loading a sliding window
View query.sql
,BIGINT (DATE) AS DATEERN -- this is used as ERN field
,CASE Kundennummer WHEN '0' THEN '9999'||lpad(dayofyear(date),4,'0') ELSE Kartennummer END CONCAT '|' CONCAT BIGINT (DATE) AS DateKey
THEN '20161231'
gitfvb / Convert-XMLtoPSObject.ps1
Created Dec 3, 2020
Allow xml to pscustomobject transformation in PowerShell to allow conversion to json, copied from
View Convert-XMLtoPSObject.ps1
Conversion of valid xml into a PSCustomObject, so it can be easily used to create json instead
Inspired from the C# example from: Translated into PowerShell from
This script uses xml input and converts all tags and attributes into a PSCustomObject.
This allows a much easier transformation into a json object.
# Using this input xml (could also be a file) ...
gitfvb /
Created Dec 3, 2020
R profile file for including some scripts at startup
# Things you might want to change
# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")
# set the default help type
# options(help_type="text")
gitfvb / gist:121f888648f707a0b477d9c8cafc8646
Last active Sep 10, 2020
Use OBS for Videorecording of Screen and Webcam
View gist:121f888648f707a0b477d9c8cafc8646

Setup OBS

  • E.g. double your screen resolution like here:




gitfvb / timer.ps1
Created Sep 4, 2020
A timer in PowerShell controlled through a "tick" event instead of a start-sleep. Script can be run standalone out of the box.
View timer.ps1
Good example inspired from here
To explore possible events, type in
$timer | gm