Skip to content

Instantly share code, notes, and snippets.

@peterldowns
peterldowns / Makefile
Last active January 14, 2025 21:03
makefile-env-var-example
## sets the value to literal empty string
SOMEVARIABLE := aaa
.PHONY: default
default:
@echo "showing the value of SOMEVARIABLE inside this make rule:"
@env | grep SOMEVARIABLE || echo "(not set)"
@echo "showing the value of ANOTHERVARIABLE inside this make rule:"
@env | grep ANOTHERVARIABLE || echo "(not set)"
@peterldowns
peterldowns / mods.yml
Created December 29, 2024 18:59
My role settings for charmbracelet/mods
# https://github.com/charmbracelet/mods
# Default model (gpt-3.5-turbo, gpt-4, ggml-gpt4all-j...).
default-model: gpt-4o
# Text to append when using the -f flag.
format-text:
markdown: 'Format the response as markdown without enclosing backticks.'
json: 'Format the response as json without enclosing backticks.'
# List of predefined system messages that can be used as roles.
roles:
default:
@peterldowns
peterldowns / .vimrc
Created June 4, 2024 23:21
iterm2 profiles with environment variables
call plug#begin()
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
call plug#end()
" In iTerm / other terms that support real colors...
if $TERM_PROGRAM != "Apple_Terminal"
set termguicolors
if $LIGHTMODE == "1"
colorscheme catppuccin_latte
else
@peterldowns
peterldowns / user-settings.json
Created June 4, 2024 23:15
Beautiful vscode
{
"window.titleBarStyle": "native",
"apc.menubar.compact": true,
"workbench.colorCustomizations": {
"focusBorder": "#ff000000",
"sideBar.background": "#00000000",
"activityBar.background": "#00000000",
"sideBarSectionHeader.background": "#00000000",
"statusBar.background": "#00000000",
"list.hoverBackground": "#00000000"
version: "3.6"
services:
testdb:
image: postgres:15
environment:
POSTGRES_PASSWORD: password
restart: unless-stopped
volumes:
# Uses a tmpfs volume to make tests extremely fast. The data in test
# databases is not persisted across restarts, nor does it need to be.
@peterldowns
peterldowns / lorri.sh
Created April 30, 2023 13:13
wsl2 service config for lorri daemon
#!/bin/bash
# Put this at /etc/init.d/lorri
# then you can do
#
# service lorri start
# service lorri status
# service lorri stop
# service lorri restart
#
# as a regular user
@peterldowns
peterldowns / preview.zsh
Created March 30, 2023 15:01
script to run a command and preview the results using fzf
#!/usr/bin/env zsh
# Opens the FZF preview in full-screen mode, and re-runs a command with any
# given arguments while allowing paging.
#
# Arguments:
# $1 = command to preview.
#
# Example:
# preview nix-search
#
@peterldowns
peterldowns / Justfile
Last active March 29, 2024 15:48
Script to generate a Makefile wrapper for a Justfile, with examples.
# this setting will allow passing arguments through to tasks, see the docs here
# https://just.systems/man/en/chapter_24.html#positional-arguments
set positional-arguments
# print all available commands by default
default:
just --list
# run the test suite
test *args='./...':
{
"claims": [
{
"timestamp": 1580933800,
"type": "ACCOUNT",
"address": "0x9A4B4f0469E5A871A27cc9451cE69A6cF769d757"
}
],
"meta": {
"address": "0xa23049064DdC56b436BB95f6B1512C553AB61D22",
{
"claims": [
{
"url": "http://138.197.234.92",
"timestamp": 1580933954,
"type": "ATTESTATION_SERVICE_URL"
},
{
"timestamp": 1580933959,
"type": "ACCOUNT",