Skip to content

Instantly share code, notes, and snippets.

@is-already-taken
is-already-taken / ideal-tank-circuit.circuitjs.txt
Created January 7, 2024 17:43
Ideal and near real modeled tank circuit (Falstad simulator)
$ 1 0.000005 0.018116748694692215 50 5 43 5e-11
s 240 0 368 0 0 1 false
c 352 256 160 256 0 1.0000000000000001e-7 -1.4853660056952276 -10
l 224 128 272 128 0 0.001 -0.04465312592466121 0
v 416 0 368 0 0 0 40 5 0 0 0.5
r 384 128 512 128 0 100
w 352 256 384 256 0
w 160 256 128 256 0
w 128 176 128 256 0
w 128 176 128 128 0
<script>
import Toast from "./Toast.svelte";
import { showToast } from "./toasts.js";
let i = 0;
</script>
<button on:click={() => { showToast("test message " + i); i++; }}>show</button>
<Toast />
<script>
import ConfirmDialog from "./ConfirmDialog.svelte";
</script>
<ConfirmDialog open={true}>
Do you want to delete the file?
</ConfirmDialog>
@is-already-taken
is-already-taken / example.ts
Created June 5, 2023 20:06
TypeScript: something that can be constructed with new keyword (newable)
type ComponentConstructorOptions = { props: any };
interface Component {
new (opts: ComponentConstructorOptions): Component;
set(name: string, value: any): void;
}
function render(component: Component): Component {
return new component({ props: { foo: 47, bar: 42 } });
}
@is-already-taken
is-already-taken / LICENSE.MIT
Created April 29, 2023 13:22
`getVariableReferenceValues()` to get names from `var()` references in a stylesheet
Copyright (c) 2023 Thomas Lehmann
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@is-already-taken
is-already-taken / broken-phase-in-us-split-phase-systems-circuit-circuitjs.txt
Created April 25, 2023 19:41
Demo of the "broken Phase" fault in US Split-Phase systems
$ 1 0.000005 0.625470095193633 33 5 50 5e-11
v 320 256 320 320 0 1 50 342 0 0 0.5
169 320 256 464 256 0 0.01 1 -153.33412299709025 1.5505874652212475 0 0.99
r 720 288 720 352 0 10
w 672 256 672 224 0
x 398 244 427 247 4 24 P1
x 398 350 427 353 4 24 P2
x 411 282 428 285 4 24 N
w 528 256 672 256 0
w 576 320 672 320 0
@is-already-taken
is-already-taken / hydrogen_ghg_summary.md
Created March 23, 2023 05:38
Indirect green house gas effect of hydrogen

The main H2 sinks are the uptake by soil bacteria (70–80% of total tropospheric removal) and the atmospheric reaction with the radical OH (20–30%), which is responsible for the indirect GHG effect of H2.

H2’s reaction with the OH radical tends to increase tropospheric methane (CH4) and ozone (O3), which are two potent greenhouse gases. It also increases stratospheric water vapor, which is associated with stratospheric cooling and tropospheric warming8,15.

Source: https://www.nature.com/articles/s41467-022-35419-7

@is-already-taken
is-already-taken / full-disk-encryption-with-debian-11-installer.md
Created December 3, 2022 16:33
Full disk encryption with Debian 11+ installer

Full disk encryption with Debian 11 installer

The Debian 11 installer creates a LUKS2 crypto container, which Grub can not read. During installation the crypto container has to be configured manually with type LUKS1.

TL;DR

  • After crypt container config, re do it manually
  • Restart the partitioner
  • Explicitly configure the crypt container "use as: none"
@is-already-taken
is-already-taken / meson.sh
Created June 13, 2021 14:50
Build meson recipe
#!/usr/bin/env bash
# https://github.com/mesonbuild/meson
version="0.50"
version_short="0.50"
git checkout ${version}
python3 setup.py install --user
@is-already-taken
is-already-taken / configure-podman.md
Last active June 15, 2021 18:20
Configure Podman

Configuring Podman

Prereqes

Install or build:

  • conmon
  • runc
  • podman