Skip to content

Instantly share code, notes, and snippets.

View bxt's full-sized avatar

Bernhard Häussner bxt

View GitHub Profile
@bxt
bxt / file-extensions.sh
Created March 14, 2024 10:46
Get repo file extensions and extensionless paths
git ls-files | sed 's/.*\.//' | sort | uniq -c | sort -u
@bxt
bxt / inverting-the-testing-pyramid.md
Last active February 17, 2024 00:30
Inverting the testing pyramid

Inverting the testing pyramid

Why avoid bugs?

Annoyance, money loss, on AWS, missing out on customers, data loss, damages, lawsuites

What is a testing pyramid?

Horizontal axis: Amount of tests.

@bxt
bxt / 1_working.rs
Last active December 13, 2022 18:32
Using a peekable iterator in a function in Rust
use std::iter::Peekable;
fn take_when_3(peeky: &mut Peekable<impl Iterator<Item = u8>>) -> Option<u8> {
if let Some(3) = peeky.peek() {
peeky.next()
} else {
None
}
}
@bxt
bxt / readme.txt
Created December 26, 2020 21:33
Anagramme
sport
prost
Bier-Tanke Antik-Rebe Eiter-Bank KI-beraten Bi-Raketen Bakterien Benkert-AI
@bxt
bxt / image.png
Last active December 26, 2020 17:33
Corona virus as an image
image.png
+ + + + [ >
+ + + + + +
+ + + + + +
+ + + < - ]
> . - - - -
- - - - - .
@bxt
bxt / cat.bf
Created December 14, 2019 02:13
Cat
🐱 in UTF-16 = 55357 56369
soo...
15*15 = 225
225 + 10 = 235
235*235 = 55225
8, 88, 38, 58, 98, 68, 78, 48, 28, 18, 80, 3, 30, 83, 33, 53, 93, 63, 73, 43, 23, 13, 1, 81, 31, 51, 91, 61, 71, 41, 21, 11, 5, 85, 35, 55, 95, 65, 75, 45, 25, 15, 50, 100, 9, 80, 39, 59, 99, 69, 79, 49, 29, 19, 90, 6, 86, 36, 56, 96, 66, 67, 46, 26, 16, 60, 7, 87, 37, 57, 97, 67, 77, 47, 27, 17, 70, 4, 48, 34, 54, 94, 64, 74, 44, 24, 14, 40, 10, 20, 2, 82, 32, 52, 92, 62, 72, 42, 22, 12
@bxt
bxt / numcompare.jsx
Created May 14, 2019 16:42
Comparison of Javascript number conversions
const potentialNumbers = [
null,
undefined,
'',
'x',
1,
1.0,
'1',
' 1',
'1 ',
@bxt
bxt / dl-ftbs.sh
Created October 12, 2017 08:51
Donwload a page recursively with wget including google cdn jquery file (Filmtage Bayerischer Schulen)
wget -r -E -H -Dwww.filmtage-bayerischer-schulen.de,ajax.googleapis.com -p -e robots=off -k http://www.filmtage-bayerischer-schulen.de/