Skip to content

Instantly share code, notes, and snippets.

View thomd's full-sized avatar

Thomas Dürr thomd

  • Hamburg, Germany
View GitHub Profile
@thomd
thomd / ngrams.json
Created March 1, 2024 18:25
english ngrams
This file has been truncated, but you can view the full file.
{
"letters": {
"E": 445155370175,
"T": 330535289102,
"A": 286527429118,
"O": 272276534337,
"I": 269731642485,
"N": 257770795264,
"S": 232082812755,
"R": 223767519675,
@thomd
thomd / software.md
Created February 28, 2023 16:53
software I like #list #software
@thomd
thomd / test.sql
Last active December 13, 2022 14:35
create a test database for learning sql #sql
CREATE DATABASE IF NOT EXISTS test;
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
c1 BIGINT(20) NOT NULL,
c2 tinytext NOT NULL,
c3 tinytext NOT NULL,
c4 DATE NOT NULL,
@thomd
thomd / Makefile
Last active March 13, 2022 15:07
Backup all Github Repositories to AWS S3 (tested on maxOS)
NOW := $(shell date +"%Y%m%d%H%M%S")
BUCKET := thomd/github/
N_REPOS := $(shell gh repo list --source -L 200 | wc -l | sed 's/ //g')
N_GISTS := $(shell gh gist list -L 400 | wc -l | sed 's/ //g')
.PHONY: backup
backup:
@n=1; for repo in $$(gh repo list --source -L 200 --json name | jq -r '.[].name'); do echo "\033[0;90mcloning repository $${n}/$(N_REPOS):\033[0m $${repo}"; n=$$((n+1)); gh repo clone $${repo} thomd/$${repo} -- -q; done
@n=1; for gist in $$(gh gist list -L 400 | awk '{print $$1}'); do echo "\033[0;90mcloning gist $${n}/$(N_GISTS):\033[0m $${gist}"; n=$$((n+1)); gh gist clone $${gist} thomd/$${gist} -- -q; done
@tar -czf thomd_$(NOW).tar.gz thomd/
@thomd
thomd / azure-pipeline-ssl-check.yml
Last active September 6, 2023 11:59
Shell script for checking if a ssl-certificate expires within some next days. To be triggered by a cron job or a pipeline.
#
# Notify on an upcoming expiration of a SSL ceritficate
#
# SETUP
#
# Create an Variable Group 'SSL-Cert-Check' within the Pipeline Library with the variables
# SSL_HOSTNAME
# SSL_THRESHOLD_DAYS
# TEAMS_WEBHOOK_URL
#
@thomd
thomd / keyboard-shortcuts.ipynb
Last active December 17, 2021 23:55
Jupyter Notebooks Introduction #jupyter #python #markdown
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thomd
thomd / commit-message.js
Last active December 16, 2021 17:27
simple husky hook for ammending a commit message with a JIRA ID. #husky #git #jira
const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const { spawnSync } = require('child_process')
const cwd = process.cwd()
const messagePath = path.join(cwd, '.git', 'COMMIT_EDITMSG')
const JIRA_ID = new RegExp(/ABCD-\d+/)