Skip to content

Instantly share code, notes, and snippets.

View bobvanderlinden's full-sized avatar

Bob van der Linden bobvanderlinden

  • The Netherlands
View GitHub Profile
@bobvanderlinden
bobvanderlinden / http_server.sh
Last active May 14, 2020 13:13
NodeJS HTTP server one-liner
node --eval 'require("http").createServer((req, res) => { res.end(); console.log(req.method, req.url, req.rawHeaders); }).listen(8080)'
@bobvanderlinden
bobvanderlinden / Dockerfile
Last active October 13, 2021 06:52
docker-compose host access test
FROM ubuntu
RUN apt-get update
RUN apt-get -y install netcat
CMD nc -zv -w 1 $ADDRESS 8888
@bobvanderlinden
bobvanderlinden / README.md
Last active February 23, 2026 13:19
Rename Git commits in batch using interactive rebase

When working on a merge/pull request and want your Git commit history to look nice afterwards, you often need to rename commit messages. For larger merge/pull requests you might need to rename a bunch of them.

The git rebase interactive reword command comes close, but it only allows you to change commit messages one by one in sequence, instead of changing the messages in an editor in one go.

Below is the most practical way of rewriting the commit messages I have found. It uses git interactive rebase, vscode and multiple cursors.

Note that the method below doesn't work for multiline commit messages!

@bobvanderlinden
bobvanderlinden / README.md
Created May 15, 2023 20:32
devenv.yaml JSON Schema

Add to the top of devenv.yaml:

# yaml-language-server: $schema=<url/path to devenv.schema.json>
@bobvanderlinden
bobvanderlinden / README.md
Last active April 7, 2024 11:00
devenv+python+git regression

devenv git+python regression

This is an example where devenv+python will fail when the git binary from the system is based on an older libc than the libc that is used in devenv. The system git is provided here by nix develop . to simulate an older system.

$ nix develop .
# This loads an older version of git (based on an older libc).
$ devenv shell
# This uses python to run `pip install -r requirements.txt` and will try to clone a git repository from there.
# Python uses a newer libc, which is passed through to subprocesses using `LD_LIBRARY_PATH` to `git`. `git` cannot run because of an incompatible libc.
@bobvanderlinden
bobvanderlinden / README.md
Last active February 26, 2025 14:55
apply-ts-expect-error.js

For each tsc error, this adds a comment:

// TODO: Resolve type error
// @ts-expect-error
...

For each Unused '@ts-expect-error' directive error it removes the @ts-expect-error comment as well as any TODO: comment above.