Skip to content

Instantly share code, notes, and snippets.

View mormahr's full-sized avatar

Moritz Mahringer mormahr

View GitHub Profile
@mormahr
mormahr / machine.js
Last active October 16, 2020 13:15
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@mormahr
mormahr / git_prune.sh
Created August 1, 2020 20:37
Git Prune
git fetch --prune
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d

Keybase proof

I hereby claim:

  • I am mormahr on github.
  • I am mormahr (https://keybase.io/mormahr) on keybase.
  • I have a public key ASD_78K95HaKIvnLw_a84D3Ho_V4hRjBjz0HPGwkptG4mAo

To claim this, I am signing this object:

@mormahr
mormahr / useGlobalHotkeys.ts
Last active February 26, 2020 23:47
BlueprintJS Hotkeys hook
import { ReactElement, useEffect } from "react";
import {
HotkeyScope,
HotkeysEvents,
} from "@blueprintjs/core/lib/esnext/components/hotkeys/hotkeysEvents";
import { IHotkeysProps } from "@blueprintjs/core";
export function useGlobalHotkeys(renderHotkeys: () => ReactElement<IHotkeysProps>) {
useEffect(() => {
const e = new HotkeysEvents(HotkeyScope.GLOBAL)
@mormahr
mormahr / .babelrc
Created October 15, 2016 00:37
Comma-Dangle Bug ESLint v3.8.0 - Demo
{
"plugins": [
"transform-flow-comments",
"transform-function-bind",
"transform-async-to-generator",
"transform-exponentiation-operator",
"transform-class-properties",
"transform-es2015-destructuring",
"transform-es2015-spread",
"transform-es2015-parameters",
#include <iostream>
#include <iomanip>
using namespace std;
int Ack(int n, int m) {
static int aufrufe = 0;
aufrufe++;
cout << "[" << setw(6) << aufrufe << ". Aufruf] " << "Ack(" << n << ", " << m << ")" << endl;