Skip to content

Instantly share code, notes, and snippets.

View mhrstmnn's full-sized avatar

Michael Horstmann mhrstmnn

View GitHub Profile
@mhrstmnn
mhrstmnn / keybase.md
Created September 22, 2021 23:27
Keybase proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@mhrstmnn
mhrstmnn / capitalize.js
Last active July 19, 2023 01:47
Capitalization script developed to run with Node
#!/usr/bin/env node
let args = process.argv.slice(2)
if (args.length === 1) {
args = args[0].split(' ')
}
for (let i in args) {
args[i] = args[i].toLowerCase()
@mhrstmnn
mhrstmnn / find_duplicates.py
Last active June 22, 2023 01:20
Find duplicate files recursively in all subdirectories starting in the directory passed as an argument (or in the current working directory) using checksums (SHA-256)
#!/usr/bin/env python3
import sys
import os
import hashlib
class Directory:
def __init__(self, path: str) -> None:
self.path = path
#!/bin/zsh
git pull
ncu -t minor -u
yarn install
yarn upgrade
git add -A
#!/bin/zsh
brew update
brew upgrade
brew autoremove
# brew cleanup -s
rm -rf "$(brew --cache)"
#!/bin/zsh
sudo apt update
sudo apt upgrade -y
sudo apt autoremove
function padNumber(n: number): string {
return n.toString().padStart(2, '0')
}
function formatDate(
date: Date,
offset?: Partial<{
year: number
month: number
day: number
@mhrstmnn
mhrstmnn / examples.ts
Created July 19, 2023 01:51
Task queue developed to run with Deno
import { TaskQueue } from './task_queue.ts'
const queue = new TaskQueue({
rateLimiter: {
interval: 'second',
tasksPerInterval: 2,
},
})
// Example with await
@mhrstmnn
mhrstmnn / pip_install.sh
Last active February 14, 2024 15:53
Install the packages from the requirements.txt with pip in a virtual environment
#!/bin/zsh
python3 -m venv venv
source ./venv/bin/activate
python3 -m pip install -r requirements.txt
@mhrstmnn
mhrstmnn / init.lua
Last active April 24, 2024 19:37
Template for new Neovim configurations
-- help relativenumber
vim.cmd [[set relativenumber]]
-- help restore-cursor
-- help last-position-jump
vim.cmd [[autocmd BufRead * autocmd FileType <buffer> ++once
\ if &ft !~# 'commit\|rebase' && line("'\"") > 1 && line("'\"") <= line("$") | exe 'normal! g`"' | endif]]