Skip to content

Instantly share code, notes, and snippets.

View dmitriid's full-sized avatar

Dmitrii 'Mamut' Dimandt dmitriid

View GitHub Profile
#!/usr/bin/env bash
#
# tammy — a friendly wrapper around tmux.
#
# tmux is powerful but its CLI is full of cryptic flags (-h means horizontal
# but splits vertically, -s means source in one command and session in another,
# etc.). tammy replaces all of that with human-readable subcommands like
# "tammy split right", "tammy connect", and "tammy resize down 5".
#
# It also handles the annoying context-dependent differences (e.g. attach vs
@dmitriid
dmitriid / results.md
Created January 13, 2026 14:13
ollama run with temp 0, top_k 0, top_p 0, num_thread 0
FROM gemma3
PARAMETER temperature 0
PARAMETER seed 123
PARAMETER top_k 0
PARAMETER top_p 0
PARAMETER num_thread 1

And then (note the differences in the explanation section):

@dmitriid
dmitriid / req_llm.livemd
Last active November 4, 2025 19:33
req_llm stream_* tests

Untitled notebook

Mix.install([
  {:zoi, "0.8.1"},
  {:req_llm, "~> 1.0.0"},
  {:kino, "~> 0.17.0"}
])
@dmitriid
dmitriid / things.md
Last active June 29, 2025 19:15
phoenix.new "death loop"

I have both handle_event and handle_info handlers which pattern match on certain payloads

The problem mostly manifests in handle_info where (for better or for worse) I end up matching more deeply

Below are diffs directly from phoenix.new (note: phoenix.new tends to "spam" commits which makes the problem slightly worse: you end up with a lot of commits that may contain wildly invalid code)

-  def handle_info(%{event: "play_now", payload: %{song: song}}, socket) do
+ def handle_info(%{event: "play_now", payload: %{}, socket) do
@dmitriid
dmitriid / workos.md
Last active March 23, 2025 17:19
WorkOS workflows

Users and roles

The docs reads like it's enough to have roles without assigning users to organizations. Morover, AuthKit allows a user to log in without any organization (perhaps correcly, for actions and business logic to then assign something to the user).

However, even with organization_id the flow is... inscrutable:

>> REQUEST >>
@dmitriid
dmitriid / repomix-ignore.md
Last active February 11, 2025 15:50
Potential ignore rules for repomix and elixir

This is based on a Elixir Phoenix application, but should work for elixir-only apps as well (they will have fewer directories, that's all).

A typical project would have these directories and files:

_build
assets
  css
  js
 node_modules
## This porvides your settings and Auth0 secrets
## It should read them from env, but I have them hardcoded in dev :D
defmodule Telepai.Secrets do
use AshAuthentication.Secret
def secret_for([:authentication, :strategies, :auth0, :client_id], Telepai.Users.User, _) do
{:ok, "2D...."} #get_config(:client_id)
end
@dmitriid
dmitriid / Makefile
Last active May 26, 2022 08:05
Makefile: webpack, babel, stylus, eslint
### Makefile to be used when compiling assets for Event Manager
### Based on ideas from https://github.com/acdlite/the-react-way/blob/master/Makefile
###
### Requirements/assumptions of this Makefile:
### JS
### - webpack (include json and css loaders to webpack cofig just in case)
### - babel
### - eslint (eslint-plugin-react if you want more lints of your react code)
### - eslint-watch (broken until 2.0.0: https://github.com/rizowski/eslint-watch/issues/8)
### CSS
scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
(file|ftp|https|http|irc|mailto):\/\/((\w+(:\w+)?@)?\w(\w\.?)*(:\d{1,5})?\/?)?(\w(\w+\/)*)?(#\w+)?
---
scheme = (file|ftp|https|http|irc|mailto):\/\/
optional username followed by optional :password. Username and password ar alphanumeric
|

There's nothing great or particularly amazing about Angular and its build processes.

Everything Angular does is fighting against its own architectural decisions. On a high level it's like this:

  • We write in Typescript, we need to compile to Javascript
  • Typescript cannot compile our templates because they are custom templates
  • We need to compile templates
  • Typescript compiler barfs at some of our code, we need to fix the code, or the compiler, or both, or hack in between them
  • The resulting Javascript is hundreds of kilobytes larger than any competition.
  • We need to somehow reduce the size