Skip to content

Instantly share code, notes, and snippets.

View tjarksaul's full-sized avatar
🦄

Tjark Saul tjarksaul

🦄
View GitHub Profile
https://www.uber.com/en-DE/blog/dynamodb-to-docstore-migration/
https://econlife.com/2018/09/unintended-consequences-from-fines/
https://levelup.gitconnected.com/7-amazon-sqs-configurations-you-should-always-set-a948604cbde9
https://dev.to/jasuperior/i-was-bored-so-i-brought-rust-enums-to-typescript-a-tale-of-questionable-life-choices-2l7b
@tjarksaul
tjarksaul / map_control_option.sh
Created November 28, 2024 09:33
Map right control key to option on Keychron K3
#!/bin/sh
hidutil property --matching '{"ProductID": 0x250}' --set '{"UserKeyMapping":[\
{\
"HIDKeyboardModifierMappingSrc": 0x7000000E4,\
"HIDKeyboardModifierMappingDst": 0x7000000E6\
}\
]}'
@tjarksaul
tjarksaul / slack-theme.txt
Created October 11, 2024 08:18
Slack Theme
#EAEAEA,#CBCCCF,#0E9DD3,#2FA659
@tjarksaul
tjarksaul / set-date-time-formats.sh
Last active July 12, 2024 07:40 — forked from chris-79/set-date-time-formats.sh
Set my preferred date and time formats on OS X
# declare my US locale
defaults write NSGlobalDomain AppleLocale -string "en_US@currency=EUR"
defaults write com.apple.systempreferences AppleIntlCustomFormat -dict-add "AppleIntlCustomLocale" "en_US"
# date string formats
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict-add "1" "dd.MM.yy"
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict-add "2" "dd MMM yy"
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict-add "3" "dd MMMM yy"
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict-add "4" "EEEE, dd MMMM y"
#!/usr/bin/env python3
import os
import subprocess
import tempfile
import sys
import shutil
import glob
import requests
from datetime import datetime
@tjarksaul
tjarksaul / autosetup_external_monitor.py
Created August 3, 2023 12:27 — forked from debsankha/autosetup_external_monitor.py
Automatically setup external monitors
#!/usr/bin/env python3
"""
Automatically setup external monitors at MOIA so that it's to the right of the
internal screen
Prerequisite: [displayplacer](https://github.com/jakehilborn/displayplacer)
```bash
brew tap jakehilborn/jakehilborn && brew install displayplacer
```
@tjarksaul
tjarksaul / git-update
Last active February 10, 2023 13:06 — forked from steve-jansen/git-update
A custom script for git to stash any working changes, pull origin main, and unstash your working changes
#!/bin/bash
stash() {
# check if we have uncommited changes to stash
git status --porcelain | grep "^." >/dev/null;
if [ $? -eq 0 ]
then
if git stash save -u "git-update on `date`";
then
@tjarksaul
tjarksaul / Readme.md
Last active November 17, 2021 09:23
Slack Status Automatization
  1. Copy this Zap into your Zapier account and connect your Slack account: https://zapier.com/shared/532ac667d67cd8fceefccc83cc2169488679056d
  2. Copy both files above into your Mac's $HOME/Library/LaunchAgents
  3. Replace the hoook URL in slackstatus.sh with the hook URL you get from Zapier, and replace [OFFICE NETWORK SSID] with your office's network SSID. Also update status emojis and text as you see fit
  4. Replace [USERNAME] in local.slackstatus.plist with your user account name
  5. Run launchctl load -w ~/Library/LaunchAgents/local.slackstatus.plist
  6. ???
  7. Profit
#!/usr/bin/env python3
import sys
import os
import csv
import xlsxwriter # pip3 install xlsxwriter
from typing import List
def convert_row(row: List[str]) -> List[str]:
row[3] = convert_gender(row[3])
@tjarksaul
tjarksaul / certbot.sh
Last active November 10, 2020 08:51
Certbot with DNS validation and tinydns
#!/bin/bash
DOMAIN="example.tld"
certbot certonly -n --preferred-challenges dns --manual --manual-public-ip-logging-ok --manual-auth-hook /usr/local/bin/tinydns-certbot-enable --manual-cleanup-hook /usr/local/bin/tinydns-certbot-disable -d $DOMAIN -d \*.$DOMAIN