Skip to content

Instantly share code, notes, and snippets.

View dviererbe's full-sized avatar

Dominik Viererbe dviererbe

View GitHub Profile
@dviererbe
dviererbe / PINOUT_NodeMCU.h
Last active June 20, 2020 20:51
NodeMCU pin mapping. The pin labels written on the board do NOT correspond to the GPIO numbers of the board.
#ifndef PINOUT_NodeMCU_h
#define PINOUT_NodeMCU_h
#define SDA 4
#define SCL 5
#define D0 6
#define D1 5
#define D2 4
#define D3 0
@dviererbe
dviererbe / Gender.cs
Last active October 26, 2021 12:28
C# ISO/IEC 5218 implementation – Codes for the representation of human sexes.
/// <summary lang="de">
/// Internationale Standard ISO/IEC 5218 – Codes für die Darstellung des Geschlechts von Menschen.
/// </summary>
/// <summary lang="en">
/// International Standard ISO/IEC 5218 – Codes for the representation of human sexes.
/// </summary>
/// <remarks lang="de">
/// Im Standard ist explizit ausgeführt, dass mit der Verwendung von 1 für männlich und 2 für weiblich
/// keine Wertigkeit ausgedrückt wird, sondern dies auf existierender Praxis in den initiierenden Ländern
/// basiert. Eine mögliche frühere Wertung wird damit nicht ausgeschlossen.
git config --global init.defaultBranch main
git config --global core.eol lf
git config --global core.autocrlf input
# Configure Identity & enable Commit-Signing by default
git config --global user.name Dominik Viererbe
git config --global user.email me@dviererbe.de
git config --global commit.gpgsign true
git config --global user.signingkey 2B14C68A4A739CB2AE243232964830C0D13518D5

Keybase proof

I hereby claim:

  • I am dviererbe on github.
  • I am dviererbe (https://keybase.io/dviererbe) on keybase.
  • I have a public key ASDquEpFPmeoDXNTL0Ax2l7Slx2tycfcUOVfi9a_ldgXBQo

To claim this, I am signing this object:

using System;
using System.Linq;
using System.Collections.Generic;
public static class Dominoes
{
public static bool CanChain(IEnumerable<(int, int)> dominoes)
{
if (dominoes.Any())
return CanChain(dominoes.ToArray().AsSpan());
@dviererbe
dviererbe / DeleteAllObjectsOfS3Bucket.cs
Created May 8, 2022 14:08
A simple script that deletes all objects located in an S3 Bucket.
// uses AWSSDK.S3 NuGet Package
using Amazon.S3;
using Amazon.S3.Model;
// TODO: paste access key here
const string AccessKey = "";
// TODO: paste secret key here
const string SecretKey = "";
@dviererbe
dviererbe / LaunchpadCommentSyntax.md
Created April 12, 2023 15:57
A document that describes how Launchpad parses bug comments.

Launchpad Comment Parsing

Whitespace

Launchpad will

  • cut off any whitespace to the right and
  • keep any whitespace to the left and
  • reduce any whitespace between non-whitespace characters to just one.

Note: Technically Launchpad passes whitespace through and the browser just ignores the whitespace.

#!/usr/bin/env bash
function PrintUsage
{
echo "Description:"
echo " Creates a temporary directory name that is not taken before running"
echo " this command. Works simillarly to mktemp but with incremental number"
echo " suffix (e.g. tmp_1, tmp_2, ...)"
echo ""
echo "Usage:"
@dviererbe
dviererbe / codium-adapter-for-sensible-editor.sh
Created May 18, 2023 16:33
Adapter script to call Codium from sensible-editor with the +n syntax.
#!/usr/bin/env bash
set -eo pipefail
case "$#" in
"0")
codium --wait
;;
"1")
codium --wait "$1"
@dviererbe
dviererbe / PrintSupportedRuntimeIdentifiers.fsx
Last active May 19, 2023 14:17
A test script that checks if all supported RIDs are buildable via the dotnet CLI
open System
open System.IO
open System.Text.Json
let printUsage() =
printfn "Usage:"
printfn $" dotnet fsi {fsi.CommandLineArgs[0]} help"
printfn $" dotnet fsi {fsi.CommandLineArgs[0]} <path>"
printfn ""
printfn "Commands:"