Skip to content

Instantly share code, notes, and snippets.


Ruben Horn rubenhorn

  • Germany
View GitHub Profile
rubenhorn /
Created Mar 13, 2022
Generate Firebase ID token for SMS based authentication
import argparse, requests
url_request_code = (
url_sign_in_with_phone_number = (
rubenhorn / .vimrc
Last active Jan 21, 2022
My current .vimrc
View .vimrc
" Plugin manager
execute pathogen#infect()
filetype plugin indent on
" Syntax highlighting
syntax on
" Line numbers
set number
" Support for emojis
set encoding=utf-8
rubenhorn /
Last active Jan 3, 2022
Simple command line tool for updating AWS MFA session credentials
import json
from pathlib import Path
from subprocess import PIPE, Popen
import sys
Before using this script:
- Configure AWS cli to output JSON (
rubenhorn / random-wallpaper.ps1
Created Jul 6, 2021
Run from autostart folder using .bat-script with: start /min powershell -File path\to\random-wallpaper.ps1
View random-wallpaper.ps1
# Settings
$superSampling = 2
$urlTemplate = "{width}/{height}?grayscale"
# Await connection
$null = $urlTemplate -match "^https?://([^/]*)/"
rubenhorn /
Last active Jun 23, 2021
Simple TOTP implementation using Python
import time, hashlib, hmac, base64
secret = 'q5ma qo4x irgv cm6k auai kjyv ak57 5keu'
T_0 = 0
X = 30
d = 6
K = base64.b32decode(secret.upper().replace(' ', ''))
rubenhorn /
Last active May 26, 2021
The following snippets can be used to build a (cross platform) script to manage a local Anaconda environment by anyone.

Conda snippets

The following snippets can be used to build a cross platform script to manage a local Anaconda environment by anyone.

Create new environment

conda create -y -p ./.env python=3.9 && conda activate ./.env

Deactivate environment

conda deactivate

Remove environment

rubenhorn /
Last active Mar 18, 2021
A script to process youtube playlist takeout
import os, sys, requests, re, html
banner = '''
# A script to process youtube playlist takeout
rubenhorn / summon_window.ahk
Last active Dec 13, 2020
AutoHotkey script for moving active window to main monitor
View summon_window.ahk
#SingleInstance force
; Hotkey: Alt + S
; Check if window active window exists
WinGetTitle, t, a
if(t = "Program Manager" or t = "") {
MsgBox ,, No window selected!, Please select a window.`n(Alt + Tab)
rubenhorn / retrolink-nes-controller.js
Created Dec 10, 2020
Function for reading input from Retrolink NES controller ( in the browser
View retrolink-nes-controller.js
rubenhorn /
Last active Aug 16, 2020
Neural network digit recognition example with GUI
# Based on
# Requires numpy, pygame, tensorflow and tensorflow-datasets
import numpy as np
import pygame
pygame.display.set_caption('MNIST digits')