Skip to content

Instantly share code, notes, and snippets.

View tstelzer's full-sized avatar

Timm Stelzer tstelzer

View GitHub Profile
@tstelzer
tstelzer / puml-theme-kauz-light.puml
Created August 24, 2023 09:57
plant-uml-theme-kauz-light
!$THEME = "kauz-light"
!define C_WHITE #ffffff
!define C_GRAY1 #f0f0f0
!define C_GRAY2 #e1e1e1
!define C_GRAY3 #d2d2d2
!define C_GRAY4 #c3c3c3
!define C_GRAY5 #b4b4b4
!define C_GRAY6 #a5a5a5
!define C_GRAY7 #969696
import * as T from '@effect/core';
import {pipeEffect} from '@effect/core/io/Effect';
import {millis} from '@tsplus/stdlib/data/Duration';
import fs from 'fs';
import fetch from 'node-fetch';
import os from 'os';
import path from 'path';
import {fileURLToPath} from 'url';
const formatUsage = (n: number): string => `${(n / 2 ** 20).toFixed(2)} MB`;
import * as T from '@effect-ts/core/Effect';
import * as Has from '@effect-ts/core/Has';
type T = (a: any) => (b: any) => T.UIO<void>;
export const tag = Has.tag<{foo: T}>(Symbol('foo'));
export type ShapeFn2<T> = Pick<
T,
{
[k in keyof T]: T[k] extends (
@tstelzer
tstelzer / Runtime.ts
Created March 11, 2022 22:00
alternative effec-ts/node/Runtime to print JSON instead of raw text
import type {CustomRuntime} from '@effect-ts/core/Effect';
import * as T from '@effect-ts/core/Effect';
import {defaultRuntime} from '@effect-ts/core/Effect';
import * as Cause from '@effect-ts/system/Cause';
import * as Pretty from '@effect-ts/system/Cause/Pretty';
import {AtomicBoolean} from '@effect-ts/system/Support/AtomicBoolean';
import * as N from '@effect-ts/node/Runtime';
import * as IO from '@effect-ts/core/IO';
import * as A from '@effect-ts/core/Collections/Immutable/Array';
{stdenv, bash, jre, fetchzip, lib}:
let
version = "11.2.1";
pname = "iosevka-ss08";
in stdenv.mkDerivation rec {
inherit pname version;
src = fetchzip {
url = "https://github.com/be5invis/Iosevka/releases/download/v${version}/ttf-${pname}-${version}.zip";
sha256 = "0m1imm5zmgkj26xpqhgqcs2aab07ib0as7p9cw876ndi6ysmhla5";
@tstelzer
tstelzer / default.nix
Last active May 3, 2021 13:00
efm-languageserver derivation
{ buildGoModule, fetchFromGitHub, lib }:
buildGoModule rec {
pname = "efm-languageserver";
version = "0.0.29";
src = fetchFromGitHub {
owner = "mattn";
repo = "efm-langserver";
rev = "v${version}";
{ stdenv, fetchurl, dpkg , alsaLib, atk, cairo, cups, curl, dbus, expat,
fontconfig, freetype, glib , gnome2, gnome3, libnotify, libxcb, nspr, nss,
systemd, xorg, wrapGAppsHook, at-spi2-atk, libsecret }:
let
version = "1.20.5";
rpath = stdenv.lib.makeLibraryPath [
alsaLib
@tstelzer
tstelzer / main-with-naive-impl.rs
Created April 16, 2020 16:34
Rust Closures Cache
struct Cacher<T>
where
T: Fn(u32) -> u32,
{
calculation: T,
value: HashMap<u32, u32>,
}
impl<T> Cacher<T>
@tstelzer
tstelzer / index.html
Created September 14, 2019 18:24
intro-web-programming
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="description">
<meta name="author" content="Timm Stelzer">
<link rel="stylesheet" href="./styles.css">
@tstelzer
tstelzer / validation.ts
Last active January 26, 2019 17:32
an attempt at applicative validation
import {array} from 'fp-ts/lib/Array';
import {getArrayMonoid} from 'fp-ts/lib/Monoid';
import {
failure as _failure,
Failure as _Failure,
getApplicative,
isSuccess as _isSuccess,
success as _success,
Success as _Success,
Validation as _Validation,