Skip to content

Instantly share code, notes, and snippets.

View thomersch's full-sized avatar

Thomas Skowron thomersch

View GitHub Profile
@strfry
strfry / README.md
Last active April 10, 2024 13:21
Deploys FreeBSD on a Hetzner cloud server

Deploys FreeBSD on a Hetzner cloud server

Prerequisites:

  • A Hetzner Cloud API Token (Pass in via APIKEY)
  • jq
  • sshpass

Usage

Replace server_id variable with your hetzner server Id
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# addnote.py by JP Mens (September 2015), inspired by Martin Schmitt
# Usage: addnote subject "body (may be empty") [image ...]
# Adds a Notes.app (OSX and iOS) compatible message to the "Notes"
# IMAP folder. The IMAP store is configured from a file called
# `creds':
#
# [imap]
# hostname =
@paulirish
paulirish / what-forces-layout.md
Last active May 6, 2024 07:54
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@MichaelKreil
MichaelKreil / gist:8db395b08bd46388c031
Created May 11, 2015 14:39
Die Geschichte von der Steinsuppe

Die Geschichte von der Steinsuppe

Vor langer Zeit, irgendwo in Osteuropa, gab es in einem Dorf eine große Hungersnot. Die Menschen im Dorf wurden selbstsüchtig, horteten alle Lebensmittel, die sie finden konnten, und versteckten sie sogar vor ihren eigenen Freunden und Nachbarn.

Eines Tages kam ein Wanderer mit einem großen Kessel auf dem Rücken in das Dorf und wollte dort die Nacht verbringen.

"Es gibt nicht einen Happen in der ganzen Provinz zu essen", wurde ihm gesagt. "Du solltest lieber weiterziehen."

"Oh, ich habe alles was ich brauche", sagte er. "Tatsächlich wollte ich eine Steinsuppe kochen und mit euch allen teilen." Er nahm seinen Kessel vom Rücken, füllte ihn mit Wasser, stellte ihn in die Mitte des Marktplatzes und entzündete ein Feuer darunter. Dann, mit einer großen Zeremonie, zog er einen gewöhnlich aussehenden Kieselstein aus einem Samtbeutel und warf ihn in das Wasser.

@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@meaku
meaku / DEUTSCHskript.js
Created January 28, 2013 12:33
Das node.js HTTP-Server Beispiel umgesetzt in "DEUTSCHskript"
//knoten.js Netzdiener-Beispiel in DEUTSCHskript
var Http = FordereAn('http');
Http.ErstelleDiener(Funktion (Anf, Ant) {
Ant.SchreibeKopf(200, { "Inhalts-Art" : "text/blank"});
Ant.Beenden("Hallo Welt \n");
}).höre(1337, "LokalerGastgeber");
@moraes
moraes / gist:2141121
Last active May 1, 2023 19:02
LIFO Stack and FIFO Queue in golang
package main
import (
"fmt"
)
type Node struct {
Value int
}