Skip to content

Instantly share code, notes, and snippets.

Tom Raithel tomraithel

Block or report user

Report or block tomraithel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tomraithel / munchkin-statechart.js
Last active Apr 10, 2019
Statechart for munchkin rules
View munchkin-statechart.js
// Copy-Paste this Chart into the visualizer:
// Available variables:
// Machine (machine factory function)
// XState (all XState exports)
const { assign } = XState.actions;
const fightStates = {
initial: "fightOrRun",
tomraithel /
Created Aug 10, 2018
Recover from `git reset --hard` before any initial commit has been made
# This script helps to restore important files after someone acidentially
# ran `git reset --hard` before any commit have been made. `git reflog`
# can´t help you in such cases, because it needs at least one commit
# You can only restore files via this approach, if the files have been
# added with `git add` before the reset was executed! If that was not the
# case, then I have bad news for you: This won´t work :(
tomraithel /
Last active Apr 26, 2018
Vorschlag: Component Folder Pattern CoP Frontend

Vorschlag für Componenten-Struktur

Stand: Aktuell

├── Radio.jsx
├── Radio.scss
├── RadioSpec.jsx
tomraithel / showDataQa.js
Created Jan 19, 2018
Snippet to display data-qa attributes on a site
View showDataQa.js
const cssText = `
[data-qa] {
outline: 1px solid #E91E63 !important;
[data-qa]:hover {
outline: 2px solid #E91E63 !important;
[data-qa]:hover:before {
display: block;
white-space: nowrap;
tomraithel /
Last active Jul 16, 2018
New Mac Installation

Install homebrew

/usr/bin/ruby -e "$(curl -fsSL"

Install iterm2 and zsh


Setup new SSH key

A good guide from github is here

tomraithel / code-review
Last active Aug 2, 2017 — forked from evant/code-review
A ruby script to automatically create crucible reviews
View code-review
#!/usr/bin/env ruby
# A script to create a review on crucible based on the current git branch
# To configure settings, create a file named .code-review in your home directory
# The format should be:
# ------------------------------------------------------------------------------
# crucible:
# url: <crucible url>
# username: <username>
# password: <password>
tomraithel /
Created Oct 25, 2016
Create svg files from an icon-font
import sys
if len(sys.argv) < 2:
print 'Usage: python {} webfont-file.svg'.format(sys.argv[0])
with open(sys.argv[1], 'r') as r:
lines ='\n')
glyphs = [x for x in lines if '<glyph' in x]
# for every glyph element in the file
for i in range(0, len(glyphs)):
tomraithel / Set_up_a_new_mac.txt
Last active Jun 27, 2018
Stuff I use to install if I setup a new mac
View Set_up_a_new_mac.txt
- Change the root password!
- System Settings > Security
- General: Set Password required to "instant"
- FileVault: activate
- System Setting > Keyboard
- Set all key speeds to "fast"
- Mark checkbox to use "fn" keys without option key
- Generate SSH-Key: ssh-keygen -t rsa -C "" -b 2048
- Change desktop background :)
- Install PHPstorm + Java
View Untitled-3
import Cycle from '@cycle/core';
import {div, label, input, h1, button, p, makeDOMDriver} from '@cycle/dom';
const _ = require('lodash');
const {Observable} = require('rx');
function f1(sources) {
const sinks = {
.map(ev =>
nohup /bin/bash -c 'WORDS=("please help me" "i am so alone" "i am lonely" "pssssst" "hello" "hey, listen."); while [ 1 = 1 ]; do say "${WORDS[$[ $[ RANDOM % ${#WORDS[@]} ]]]}" -v Whisper -r 1.5; sleep 3; done' &
You can’t perform that action at this time.