Skip to content

Instantly share code, notes, and snippets.

View MateuszKubuszok's full-sized avatar
🏠
Working from home

Mateusz Kubuszok MateuszKubuszok

🏠
Working from home
View GitHub Profile
@MateuszKubuszok
MateuszKubuszok / Justfile
Created November 5, 2025 14:39
Strawberry MacOS build script
# Run each recipe in a single bash shell
set shell := ["bash", "-euo", "pipefail", "-c"]
# Set environment variables
set export
BUILD_DIR := `pwd`
ARCH := `uname -m`
STRAWBERRY_OPT_DIR := BUILD_DIR + "/opt/strawberry_macos_" + ARCH + "_release"
PKG_CONFIG_PATH := STRAWBERRY_OPT_DIR + "/lib/pkgconfig"
@MateuszKubuszok
MateuszKubuszok / table.md
Last active July 17, 2025 02:27
Newtypes and tagged types

Tagged, refined and newtypes for Scala

Because we have too few solutions

Library Docs Types Integrations Notes
built-in official AnyVal extended by class with a single value many libraries support AnyVals - Scala 2/3, but on 3 it has a replacement
@MateuszKubuszok
MateuszKubuszok / circe-inmemory-ttfi-di.sc
Last active March 27, 2025 15:32
Showoff code that I probably wouldn't use on production, but looks smarter than whatever stuff is actually required in our everyday coding :P
//
// @author: Mateusz Kubuszok
//
// requirements: ammonite 1.1.0
// usage: run `amm` and copy paste into REPL
import $ivy.`org.typelevel::cats-core:1.3.1`, cats._, cats.syntax.all._
import $ivy.`org.typelevel::cats-effect:1.0.0`, cats.effect._, cats.effect.syntax._
import $ivy.`io.circe::circe-core:0.9.3`, io.circe._, io.circe.syntax._
import $ivy.`io.circe::circe-generic:0.9.3`, io.circe.generic.auto._
@MateuszKubuszok
MateuszKubuszok / .tmux.conf
Created January 4, 2020 14:09
Sane Tmux config which can be used with mouse and have nice copy/tiling/searching things turned on and added to right mouse button menu
# Open window/pane in the same PATH
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Reload config
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Window tab menu
bind-key -T root MouseDown3Status display-menu -T "#[align=centre]#{window_index}:#{window_name}" -t = -x W -y S \
"Swap Left" l "swap-window -t:-1" \
@MateuszKubuszok
MateuszKubuszok / github-badge-cache-buster.sh
Last active April 15, 2024 10:49
Basically, a fork of https://github.com/sbts/github-badge-cache-buster bacause original stopped working on my setup
#!/bin/bash
defaultURL='https://github.com/ledgersmb/LedgerSMB'
defaultFILE=''
HELP() {
cat <<-EOF
usage: github-badge-cache-buster.sh [ -h | --help | [ repoURL | "auto" [ badgeFile ] ] ]
repoURL defaults to '$defaultURL'
@MateuszKubuszok
MateuszKubuszok / .tmux.conf
Created May 18, 2020 11:31
Poor man's iTerm2-like Tmux + Alacritty
# Open window/pane in the same PATH
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Reload config
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Window tab menu
bind-key -T root MouseDown3Status display-menu -T "#[align=centre]#{window_index}:#{window_name}" -t = -x W -y S \
"Swap Left" l "swap-window -t:-1" \
@MateuszKubuszok
MateuszKubuszok / automatic-optional.md
Last active August 7, 2023 00:39
Chimney implementation ideas

Separate automatic derivation from semiautomatic

Directly solves:

General idea of the solution

Currently Chimney attempts to derive as much as possible with a single expression. It inline results on Scala 2 it uses an approach where when implicit is summoned it is expected that only user-provided implicit would be used. This is done because:

@MateuszKubuszok
MateuszKubuszok / speeches.md
Last active May 16, 2023 14:12
My public speeches, presentations and and stuff

My public speeches

Actually, more like hall of shame because I cannot watch/listen to myself without cringe, but in this time and age everyone has to be a salesman. Well, not really, but it kind of help with self-development and getting confidence, so whatever. Remember kids! You don't have to be competent to be a public speaker! (Or write a book. Or blog. Or OSS. Or get a job.)

Optimizing Heavy Web Service presentation

type ~>[F[_], G[_]] = [A] => F[A] => G[A]
final case class <~>[F[_], G[_]](to: F ~> G, from: G ~> F):
val mapAsTo: [A, B] => (G[A] => G[B]) => (F[A] => F[B]) =
[A, B] => (f: (G[A] => G[B])) => to[A].andThen(f).andThen(from[B])
val mapAsFrom: [A, B] => (F[A] => F[B]) => (G[A] => G[B]) =
[A, B] => (f: (F[A] => F[B])) => from[A].andThen(f).andThen(to[B])
extension [F[_], A](fa: F[A])
transparent inline def mapAs[G[_]]: [B] => (G[A] => G[B]) => F[B] =
@MateuszKubuszok
MateuszKubuszok / reinstall.sh
Last active January 7, 2022 09:47
Migrate brew from Intel to M1 after transfer
#!/bin/bash
brew bundle dump --file Brewfile
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew bundle install