Skip to content

Instantly share code, notes, and snippets.

View oelna's full-sized avatar
😔
The light inside has broken, but I still work

Arno Richter oelna

😔
The light inside has broken, but I still work
View GitHub Profile
@oelna
oelna / hash.md
Last active September 23, 2022 15:46
Collection of hash algorithms for frontend/Javascript development
@oelna
oelna / shortcuts.js
Last active April 10, 2022 15:06
Quick $ and $$ wrappers for querySelector
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
@oelna
oelna / flexbox.css
Last active April 1, 2022 14:39
Rasterexperimente mit Flexbox und Grid, HTML-Kurs April 2022
html {
font: 125%/1.2 system-ui;
background-color: #999;
}
img {
max-width: 100%;
height: auto;
display: block;
}
@oelna
oelna / cats.txt
Created January 21, 2022 11:08
Katzenrassen
Abessinier
Ägyptische Mau
American Bobtail Shorthair
American Curl Shorthair
American Shorthair
American Wirehair
Anatoli
Arabische Mau
Asian
Australian Mist
@oelna
oelna / file-compression.md
Last active May 29, 2021 13:29
Merkblatt zur Kompression von Bildern, Videos und Audio-Daten

Merkblatt zur Dateikompression

Die Bitrate bestimmt die Qualität des Inhalts. Wird sie größer, steigen Qualität und Speicherbedarf an. Bilddimensionen, bzw. Länge des Musikstücks beeinflussen ebenfalls die Dateigröße: Höhere Auflösung bewirkt in der Regel größeren Platzbedarf.

Übersicht über Formate

Kompression Bild Video Audio
lossy JPG, PNG-8, WEBP, HEIC H.264, H.265, DivX, Xvid, 3GP, MJPEG MP3, AAC, OGG
lossless PNG-24 DV-PAL, PNG FLAC, APE, ALAC, AIFF, WAV
@oelna
oelna / bingo.php
Last active March 5, 2021 00:01
A generator for unique Bingo cards in PHP. See in action https://bingo.arnorichter.de/ (generates cards printable on A4 paper size)
<?php
/*
Generate however many unique bingo cards you require (should be fewer than 10k though).
This is not meant to compute ALL possible bingo cards, obviously, but to help set up a
nice amount of cards for play.
If you require a free space somewhere on the board, you should probably tweak the output,
not the generator.
I wrote this because existing solutions on stackoverflow were in languages I could not
test as easily and many existing generator websites generate crap cards that do not
adhere to the bingo number distribution in the 5 rows, so you spend an eternity looking
@oelna
oelna / dump_github_issues.sh
Created January 24, 2016 19:45
Export Github issues from the command line
#!/bin/bash
echo "Please enter your Github username"
read username
echo "Please enter your Github password"
read -s password
echo "What is the Github repo you'd like to download issues from?"
echo "Format is user/repo"
@oelna
oelna / metatags.html
Last active June 29, 2020 18:29
List of the most common metadata in the HTML head
<!DOCTYPE html>
<html lang="de">
<head>
<!-- Encoding des Dokuments festlegen -->
<meta charset="utf-8" />
<title>Meta und Link Tags</title>
<meta name="description" content="The MDN Web Docs Learning Area aims to provide complete beginners to the Web …" />
<meta name="author" content="Chris Mills" />
<meta name="copyright" content="1998, your name" />
@oelna
oelna / commands.md
Last active June 12, 2020 12:05
A few custom Nightbot commands to use on Twitch

Nightbot custom commands

This is an incomplete list of Nightbot commands I use on my Twitch channel to facilitate the teaching of webdesign. Many commands only generate links to specific sites, but some also offer advanced functionality, such as RNG. You should probably adjust the code, if you'd like to use them.

Random Number

Command: !random
Description: Generate a random number between 1 and 100, or a specific interval
Usage: !random, !random 1 10 or !random 5 20

$(eval if ($(1) && $(2)) {
@oelna
oelna / challenge.js
Created June 3, 2020 12:19
Calculate luck in Javascript, based on a RPG stat
/*
Calculate a RNG value with a percent chance to succeed,
based on a range and an stat input value somewhere between.
This is how the challenges in Sunless Sea work, for example.
- The lower bound defines a starting value required to get over 0%
- The upper bound defines the value at which you always succeed
- The stat value should between the two in order to produce a meaningful chance.
*/