Skip to content

Instantly share code, notes, and snippets.

View lambda-mike's full-sized avatar

Michał Grygierzec lambda-mike

View GitHub Profile
@lambda-mike
lambda-mike / nix_python.py
Created July 20, 2020 05:17
Reproducible builds Nix starter script for Python
#! /usr/bin/env nix-shell
#! nix-shell --pure -i python -p "python38.withPackages (ps: [ ps.django ])"
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/82b5f87fcc710a99c47c5ffe441589807a8202af.tar.gz
import django
print(django)
@lambda-mike
lambda-mike / Nu_cheatsheet.md
Last active April 10, 2025 19:49
Nu shell cheatsheet

Rust

Cargo

cargo new --bin myproj

cargo new --lib mylib

cargo build --release

@lambda-mike
lambda-mike / 12_factor_apps.md
Last active August 14, 2020 17:52
12 Factor apps - my notes

12 Factor Apps

12 Factor Apps

I. Codebase

Multiple apps sharing the same code is a violation of twelve-factor. The solution here is to factor shared code into libraries which can be included through the dependency manager.

II. Dependencies

Doom Emacs

Top

  • SPC q q quit
  • SPC SPC find file in project
  • SPC . find file (slower)
  • SPC , open a workspace buffer
  • SPC f p edit private config files
  • SPC f r recently visited files

Org-mode

Basics

  • M-x org-mode enable Org mode
  • * MyHeader create header
  • TAB hide/show text below the header
  • S-TAB cycle through visibility levels
  • C-RET create another header on the same level

Remote Work

Communication

Asynchronous communication

  • Be crystal clear on what they’re asking for (if anything)
  • Pre-answer any likely follow-up questions
  • Include any details, files, or assets the recipients might need
@lambda-mike
lambda-mike / code_reviews.md
Last active February 7, 2025 05:41
Code Reviews
@lambda-mike
lambda-mike / array_of_errors.ts
Created November 17, 2021 20:23
Accumulate errors in array, keep results in record
import { pipe } from "@effect-ts/system/Function"
import { makeAssociative } from "@effect-ts/core/Associative"
import * as R from "@effect-ts/core/Collections/Immutable/Dictionary"
import * as E from "@effect-ts/core/Either"
test("example 04", () => {
const ValidationApplicative = E.getValidationApplicative(
makeAssociative<Array<string>>((l, r) => [...l, ...r])
@lambda-mike
lambda-mike / sc.ts
Created January 4, 2022 23:33
Schedule example
import * as SC from "@effect-ts/core/Effect/Schedule"
import { pipe } from "@effect-ts/core/Function"
const app1 = pipe(
T.fail("app1"),
T.retry(pipe(
//SC.exponential(1000, 2)["&&"](SC.recurs(4))["|>"](SC.jittered_),
SC.exponential(1000, 2)["&&"](SC.recurs(4)),
SC.onDecision((d) => {