Skip to content

Instantly share code, notes, and snippets.

Open for job opportunities. Visit my profile.

Lenz Weber-Tronic phryneas

Open for job opportunities. Visit my profile.
View GitHub Profile
phryneas / replay-hashes.json
Last active Apr 1, 2022 on NixOS
View replay-hashes.json
"replay": {
"url": "",
"sha256": "0pf1ihxkx8dr1hn8v84sb8pgyg4xwpvjlk6jlp5bkpzp5zhyskqy"
"recordreplay-lib": {
"url": "",
"sha256": "1sif40b7zk5mxibqpncdv00yxp7kh6jl37jq12ggm36nswwr9l7g"
phryneas / fromParens.js
Created Sep 14, 2021
View fromParens.js
This brute forces all possible () combinations by interpreting the binary
representation of an increasing number with 0 as ( and 1 as ).
Works fine for n<15. For bigger n, the amount of results will be too big for memory.
function fromParens(n) {
let ret = [],
targetLen = n * 2, // target string length
max = Math.pow(2, targetLen), // maximum number to look at
current, // current number
View package.json
"name": "foofoo",
"version": "1.0.0",
"main": "index.js",
"author": "Lenz Weber",
"license": "MIT",
"dependencies": {
"@types/node": "^14.14.41",
"typescript": "^4.2.4"

Do not create union types with Redux Action Types. It's most likely an antipattern.

So, there is a long-standing TypeScript & Redux pattern of creating a union RootAction type that contains all your application's action types. Sometimes, you would also create a lot of reducer-specific sub-unions. I think that this has always been a crutch - and given the options we have today, it's most likely an antipattern. So let's look at why it was used, where it was used and what you can use instead.

Why was it used? A look at typed Reducers.

Classically, these action union types were created to use the Discriminating Union pattern.

phryneas /
Last active Apr 24, 2020
api-documenter test


API Reference


Package Description
#!/usr/bin/env bash
#remove all git tags
git tag | xargs git tag -d
#re-apply all git tags with commit name => tag name
git log --pretty=%s---%H | sed -re 's/[^a-zA-Z0-9-]/_/g;s/---/ /' | xargs -n2 git tag
git tag --format="%(objectname) => %(refname)"
phryneas / index.d.ts
Created Sep 12, 2019
buggy types rollup
View index.d.ts
/// <reference types="react" />
import { ComponentClass } from 'react';
import * as CSS from 'csstype';
import * as PropTypes from 'prop-types';
import React from 'react';
declare interface AbstractAction {
type: string;
meta: {
counter: number;
phryneas / doczrc.js
Created Mar 4, 2019
View doczrc.js
import { resolve } from 'path';
export default {
modifyBundlerConfig: config => {
const orig = config.module.rules[2];
const origUse = orig.use;
orig.use = [
phryneas / default.nix
Created Dec 12, 2018 — forked from ottidmes/default.nix
VS Code Live Share extension
View default.nix
# Baseed on previous attempts of others:
{ lib, vscode-utils, autoPatchelfHook, bash, file, makeWrapper, dotnet-sdk
, curl, gcc, icu, libkrb5, libsecret, libunwind, libX11, lttng-ust, openssl, utillinux, zlib
, enableDiagnosticsWorkaround ? false, gccStdenv
with lib;