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.
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.
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.
Add to the top of devenv.yaml
:
# yaml-language-server: $schema=<url/path to devenv.schema.json>
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!
FROM ubuntu | |
RUN apt-get update | |
RUN apt-get -y install netcat | |
CMD nc -zv -w 1 $ADDRESS 8888 |
node --eval 'require("http").createServer((req, res) => { res.end(); console.log(req.method, req.url, req.rawHeaders); }).listen(8080)' |
local function matches(input, pattern) | |
local index = 1 | |
return function() | |
local match = input:match(pattern, index) | |
if match then | |
index = index + match:len() + 1 | |
return match | |
else | |
return nil | |
end |
This is an example how to do GraphQL queries in a somewhat sane way in bash
using curl
and jq
.
The example does an query towards GitHub to fetch the commit SHAs of open pull requests for a specific repository.
The example needs the environment variables REPO_OWNER
, REPO_NAME
and GITHUB_TOKEN
to be set.
This script is handy for setting up an ad-hoc DHCP server for instance when starting up a Raspberry PI for the first time.
dnsmasq
will output when it has given a client an address:
dnsmasq-dhcp: DHCPACK(enp0s25) 192.169.1.109 b8:27:eb:86:2f:ed nixos
these derivations will be built: | |
/nix/store/30fribf3xpmiivys1mzqp007m70p4h4v-node-v11.0.0.tar.xz.drv | |
/nix/store/k1ww35ij6c9r0vxxrqpmid1lpmhpq3zm-nodejs-11.0.0.drv | |
these paths will be fetched (95.06 MiB download, 553.67 MiB unpacked): | |
/nix/store/0ingn8cwwnl84i374hcl6nafsm2c5m2p-perl-5.28.0 | |
/nix/store/0pcxv5mzn1fz7z8aa1frczkm4gpy7dkc-libgcrypt-1.8.3 | |
/nix/store/10yq7kwlvbc6h658izmrlsspry1g9f3c-gcc-wrapper-7.3.0 | |
/nix/store/1vb4m694aj9bdm7aq3911yjjb73gn4ii-attr-2.4.47 | |
/nix/store/22zwmxhd41a1j3cf7rxjwd75w4hmxdrv-libev-4.24 | |
/nix/store/2brlr94ahy3a9mvcjy0qbqpv8zrb7b7s-python-2.7.15 |