Skip to content

Instantly share code, notes, and snippets.

View akbo's full-sized avatar

Andreas Bollig akbo

  • Aachen, Germany
View GitHub Profile

Keybase proof

I hereby claim:

  • I am akbo on github.
  • I am abollig (https://keybase.io/abollig) on keybase.
  • I have a public key ASB5TIcck51BUMKHECXgTogEHMjNqrvSB6tf-YOEZX5FVgo

To claim this, I am signing this object:

@akbo
akbo / dobble_kids_deck_generator.py
Created October 11, 2018 18:54
Generate a card deck like the one used in the game Dobble Kids
"""
There are 31 different animals and we want to have a deck of cards such that on each card there are 6 animals and every card has exactly one animal in common with every other card. Our card deck should have at least 30 cards.
"""
from itertools import combinations
from random import shuffle
from pprint import pprint
n_animals = 31
n_animals_per_card = 6
@akbo
akbo / scriptkit_black.js
Created December 15, 2021 22:30
Runs Python code formatter on selected text and pastes it back
// Name: black
// Shortcut: command+shift+b
import "@johnlindquist/kit";
// Change the below to fit your system
const tempFile = "~/scriptkit_black_temp.py";
const blackPath = "~/miniconda3/bin/black";
// copy selected text to clipboard
import crypto from "crypto";
import { renderToStaticMarkup } from "react-dom/server";
import createMailgun from "mailgun-js";
import type { ActionFunction, LoaderFunction, Session } from "remix";
import { createCookieSessionStorage, json, redirect } from "remix";
/*******************************************************************************
* Before we can do anything, we need to make sure the environment has
* everything we need. If anything is missing, we just prevent the app from
* starting up.