Skip to content

Instantly share code, notes, and snippets.

View thrau's full-sized avatar

Thomas Rausch thrau

View GitHub Profile
@thrau
thrau / tuwel-grade-import-mapper.js
Created April 8, 2017 17:27
TUWEL automatic grade item mapper
// ==UserScript==
// @name TUWEL automatic grade item mapper
// @namespace http://dsg.tuwien.ac.at/staff/trausch/
// @version 0.1
// @description Automatically selects the form fields in the grade item mapper where the item name corresponds to the column name
// @author Thomas Rausch
// @match https://tuwel.tuwien.ac.at/grade/import/*
// @grant none
// ==/UserScript==
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@thrau
thrau / reasons-to-write-shell-scripts.md
Last active August 28, 2020 12:37
Why I write shell scripts

I write scripts to:

  • combine a sequence of commands i could type manually, but am too lazy to (example: proxy-chrome)
  • turn commands i need frequently but can't remember into ones i can (example: ex, ssh-forward, ishostup, rmcaps)
  • do things recursively on a file tree (rgit, mvnrc, chres)
  • perform transformation operations on many files that are too complicated for find (svg2pdf, imgscale)
  • systematize workflows into a script (mvn-release)
  • procrastinate (gdwc)

The given examples are a subset of all the scripts I have in my doftiles that can be found in thrau/dotfiles.

@thrau
thrau / jekyll-git-post-receive
Last active October 29, 2020 13:47
git post receive hook for building jekyll website remotely
#!/bin/bash
#
# An example hook script to make use of push options.
# The example simply echoes all push options that start with 'echoback='
# and rejects all pushes when the "reject" push option is used.
#
# To enable this hook, rename this file to "pre-receive".
set -e
@thrau
thrau / README.md
Last active December 5, 2021 16:23
Run localstack with npm

Run localstack with npm

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
npm run localstack
@thrau
thrau / convert_assert.py
Last active June 14, 2022 04:02
script to covert unittest asserts to plain asserts
"""
Script to convert unittest asserts into plain asserts.
Either reads the file from the path passed as first parameter, or reads from stdin if no parameter is given.
"""
import functools
import sys
import libcst as cst
@thrau
thrau / README.md
Last active July 31, 2022 11:45
investigate hypercorn asyncio performance

Run the server

Install dependencies:

pip install quart hypercorn uvloop uvicorn

To compare hypercorn, uvicorn, and hypercorn using uvloop, run (in separate terminals)

python -m localstack.aws.asgi hypercorn 4566

python -m localstack.aws.asgi uvicorn 4567