Skip to content

Instantly share code, notes, and snippets.

View danielres's full-sized avatar

Daniel Reszka danielres

  • Pixarea studio
  • Germany
View GitHub Profile
@danielres
danielres / dev.exs.diff
Last active November 12, 2025 13:33
flake.nix for elixir development, with postgres
- password: "postgres",
- hostname: "localhost",
+ password: "",
+ socket_dir: System.get_env("PGHOST") || "/tmp",
@danielres
danielres / vim-terminals.lua
Created November 9, 2025 10:34
Lazyvim buffer terminals
return {
{
"LazyVim/LazyVim",
keys = {
-- terminal in the current window (new terminal buffer)
{
"<leader>to",
function()
vim.cmd("terminal")
end,
@danielres
danielres / elixir-igniter-rename.lua
Created November 9, 2025 10:29
Productive elixir refactoring in lazyvim, using "mix igniter.refactor.rename_function"
-- ~/.config/nvim/lua/plugins/elixir-igniter-rename.lua
local function project_root()
local ok, Util = pcall(require, "lazyvim.util")
if ok and Util.root and Util.root.get then
return Util.root.get()
end
local git = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
return (git and git ~= "") and git or vim.loop.cwd()
end
@danielres
danielres / dev.exs
Created November 8, 2025 15:53
Dev-only pretty formatter for elixir Phoenix errors
# config/dev.exs
import Config
config :phoenix, :stacktrace_depth, 60
config :logger, level: :info
config :logger, :console,
format: {PrettyConsoleFormatter, :format},
@danielres
danielres / tldr.txt
Last active July 18, 2025 23:20
tuxedo-nixos-dual
# Shrink Tuxedo / and add isolated NixOS (UEFI boot-menu dual boot)
0 Backup & snapshot (Live USB)
--------------------------------
sudo cryptsetup luksOpen /dev/nvme0n1p3 cryptroot
sudo vgchange -ay
sudo lvcreate -s -n root-pre-shrink -L 10G /dev/system/root
sudo lvs
1 Shrink Tuxedo root to 250 G
@danielres
danielres / transcribe.sh
Created April 28, 2025 12:39
Whisper transcriber (speech to text)
#!/usr/bin/env bash
# transcribe_chunks.sh — splits audio, uploads each chunk separately
# usage: transcribe_chunks.sh "input audio file"
# Requires OPENAI_API_KEY in environment.
set -euo pipefail
usage() {
echo "Usage: $(basename "$0") \"input audio file\""
echo "Requires OPENAI_API_KEY environment variable to be set."
@danielres
danielres / Readme.md
Last active April 16, 2025 05:40
Widget - Tasks - dynamic

Obsidian gists

Widget - Tasks - dynamic.md

A widget for Obsidian bringing together tasks from the entire vault of priority above medium.

The 3 buttons allow to switch their grouping:

  • by file
  • by priority
@danielres
danielres / Readme.md
Last active November 22, 2024 09:41
Convert all ChatGPPT conversations to csv

ChatGPT conversations.json to csv converter

Bash script to convert all ChatGPT conversations from .json to .csv, for example to import into Notion as a database.

Prerequisites

  • jq

Usage

  1. First export your personal data from ChatGPT (Account Settings > Data Controls > Export Data)
  2. Unzip the downloaded file
@danielres
danielres / .envrc
Last active March 15, 2024 20:55
Nix flake with node_20 + pnpm
use_flake './flake.nix'
@danielres
danielres / .zshrc
Created March 8, 2024 12:05
Running lvim with its own isolated nodejs using nix-shell
v() {
# runs nvim in a nix-shell with nodejs_20
# sets NPM_GLOBAL_DIR so no sudo is needed to install global npm packages
NODE_STR="nodejs_20"
NPM_GLOBAL_DIR="/home/$USER/.npm-global/$NODE_STR"
mkdir -p $NPM_GLOBAL_DIR
echo "running lvim $1"
echo "within nix-shell -p $NODE_STR"
PATH=$NPM_GLOBAL_DIR/bin:$PATH NPM_CONFIG_PREFIX=$NPM_GLOBAL_DIR nix-shell -p $NODE_STR --run "lvim $1"
}