Skip to content

Instantly share code, notes, and snippets.

View bxt's full-sized avatar

Bernhard Häussner bxt

View GitHub Profile
@bxt
bxt / many-files-with-errors-tutorial.md
Last active August 28, 2025 21:09
Dealing with a large number of files with errors in VS Code, migrations etc

When dealing with large, old code bases (like I'm doing on a daily basis) you'll often want to migrate something in a large quantity of files. For this, you should have the necessary tests and linters in place, to be able to change things confidently. However, what happens when errors happen? I adopted some tools for dealing with errors in a large number of files.

Tool 1: Finding files with find and git ls-files | grep

If you need to change a spefic kind of file, the most basic step will be to find and list them all. The standard CLI utility for this is find, and can be used in various ways:

find . -name 'tsconfig.json'
find src/ -iname '*test*'
find . -type d -name node_modules -prune -false -o -name package.json
@bxt
bxt / learning-music.md
Last active December 8, 2024 01:05
My journey of learning music
  • 199X-XX-XX: Someone lends me their Roland Jupiter-4 and I'm supposed to learn to play the piano on it. However, the classical education and what you can do with an analog synthesizer drif apart somehow. It was fun to play with it though, I did not know modern styles of music too much though. After a few years when the realization kicked in that those instruments are very valuable I had to return it.
  • 200X-XX-XX: Eventually I got a basic Yamaha Clavinova and some piano lessons. However, I was always too lazy to pracitce and maybe also not very talented? It lead nowhere, but I learned the basics. The Circle of fifths was a big mystery for me – why is it structured like this? When I moved to a different city I gave it away.
  • 200X-XX-XX: I remember seeing Garage Band for the first time on some tiny Apple conference, and being pretty excited about it.
  • 200X-XX-XX: A friend also tought me to play the drums for
@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