Skip to content

Instantly share code, notes, and snippets.

View simonauner's full-sized avatar

Simon Auner simonauner

View GitHub Profile
@simonauner
simonauner / are_we_typed_yet.sh
Last active March 14, 2023 22:57
Are we typed yet? A bash script that counts percentage of files converted to .ts[x] in a folder
#!/usr/bin/env bash
# By Simon Aunér 2023
# https://gist.github.com/simonauner/484f4d965d442ada60a50e3d68dc6d28
# To install in usr bin folder, run:
# sudo ln -s /path/to/are_we_typed_yet.sh /usr/local/bin/are_we_typed_yet
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
@simonauner
simonauner / InputMask.test.ts
Created October 5, 2022 06:56
Simple TypeScript Input Mask
import { createMask } from './InputMask'
describe('InputMask', () => {
const mask = '##-##-####'
it.each([
['1', '1'],
['12', '12-'],
['12-3', '12-3'],
['12-34', '12-34-'],
@simonauner
simonauner / pre-commit
Last active September 9, 2023 16:42 — forked from EtherZa/pre-commit
Format c# with dotnet-format with pre-commit hook
#!/bin/sh
# Modified from https://gist.github.com/EtherZa/581d9276336353838b2c939f9554d479
#
# This script finds the files that are about to be committed,
# and runs dotnet format on them before adding them back to staging
#
# install dotnet-format: dotnet tool install -g dotnet-format
# make sure installed dotnet tools are on your path:
# export PATH="$PATH:$HOME/.dotnet/tools/"
# copy to .git/hooks/pre-commit and make executable