Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tomraithel's full-sized avatar
🏠
Working from home

Tom Raithel tomraithel

🏠
Working from home
View GitHub Profile
@tomraithel
tomraithel / Set_up_a_new_mac.txt
Last active April 11, 2024 14:02
Stuff I use to install if I setup a new mac
- 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 "email@provider.com" -b 2048
- Change desktop background :)
- Install PHPstorm + Java
@tomraithel
tomraithel / gist:4085449
Created November 16, 2012 08:26
RUBY: Copy files from one directory into another
require 'fileutils'
# specify files which should not be copied
dont_copy = ['jquery.languageTags.js']
puts "Copying files from FE to BE folder"
from_dir = "./../FE/templates/global"
to_dir = "./../BE/trunk/htdocs/fileadmin/templates/global"
@tomraithel
tomraithel / gist:4085481
Created November 16, 2012 08:30
HTML + CSS: A flipbook-like animation with CSS3
<div class="flipbook">
<div class="page left leftpage">
<div class="pagewrap">
<div class="page_content">
Dies ist die erste Seite des flipbooks
</div>
</div>
</div>
<div class="page center">
<div class="innerpage rightpage inner_right">
@tomraithel
tomraithel / gist:4085463
Created November 16, 2012 08:28
SUBLIME: Eclipse-like key bindings (MAC)
[
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+j"], "command": "join_lines" },
{ "keys": ["super+alt+down"], "command": "duplicate_line" },
{ "keys": ["shift+super+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["super+shift+s"], "command": "save_all" },
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tomraithel
tomraithel / machine.js
Last active January 15, 2021 10:00
Generated by XState Viz: https://xstate.js.org/viz
const loggedInState = {
initial: 'idle',
states: {
idle: {
on: {
load: 'loading'
}
},
loading: {
invoke: {
@tomraithel
tomraithel / machine.js
Last active February 27, 2020 06:36
FlightSelection xState config
const wizardStates = {
initial: "date",
states: {
date: {
on: {
NEXT: "flight"
}
},
flight: {
on: {
@tomraithel
tomraithel / recover-lost-git-files.sh
Created August 10, 2018 20:30
Recover from `git reset --hard` before any initial commit has been made
#!/bin/bash
# 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
tomraithel / munchkin-statechart.js
Last active April 10, 2019 20:40
Statechart for munchkin rules
// Copy-Paste this Chart into the visualizer: https://statecharts.github.io/xstate-viz/
// Available variables:
// Machine (machine factory function)
// XState (all XState exports)
const { assign } = XState.actions;
const fightStates = {
initial: "fightOrRun",
@tomraithel
tomraithel / guide.md
Last active July 16, 2018 08:18
New Mac Installation

Install homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install iterm2 and zsh

See https://gist.github.com/kevin-smets/8568070

Setup new SSH key

A good guide from github is here