Skip to content

Instantly share code, notes, and snippets.

@tednaleid
tednaleid / mardownload-and-obsidian-setup.md
Created February 13, 2025 23:50
MarkDownload and Obsidian

Set up Obsidian and MarkDownload

The MarkDownload plugin says it has Obsidian integration that uses the "Advanced URI" Community plugin to work, but it doesn't. Just the symlink works. I tried that and didn't see any additional functionality that I cared about so disabled it.

This uses a symlinked directory in ~/Downloads/ to save files into an Obsidian vault.

Install the MarkDownload plugin for Firefox, and configure with these settings:

@tednaleid
tednaleid / docker-compose.yml
Last active January 1, 2025 19:05
minimal docker compose using KRaft and simple golang sarama code to list topics
# Minimal KRaft Kafka cluster with one broker
# create a topic with:
# docker exec -it kafka-compose-test-kafka-1 /opt/kafka/bin/kafka-topics.sh --create --topic new-topic --partitions 1 --replication-factor 1 --bootstrap-server localhost:9092
version: '3'
services:
kafka:
image: apache/kafka:3.8.0
ports:
- "9092:9092"
@tednaleid
tednaleid / 1_macos_vscode_lldb_setup.md
Last active September 6, 2021 02:25
debugging pony with vscode + lldb

Debugging Pony with VSCode and lldb

The pony language reference has a debugging section that got me pointed in the right direction for getting VSCode set up and integrated with lldb.

There were a few steps that were glossed over in the instructions, but I eventually got everything working, including:

  • breakpoints (including conditional breakpoints)
  • current variable values (including evaluated Strings not pointers)
  • watch expressions
  • step debugging
@tednaleid
tednaleid / wexec.zsh
Last active August 10, 2019 21:28
wexec - shell function to allow easy iteration on a shell command, uses watchexec to re-run a command whenever the file is saved
# add to your .zshrc/.bashrc
# sets up "live reload"-like environment for for a single file
# will watch a file (create it if it doesn't exist), every time it is saved it will run a command
EDITOR=mvim # I use MacVim but switch this to whatever you use (something that'll be outside of the same terminal window)
function wexec() {
command -v watchexec >/dev/null 2>&1 || { echo "'watchexec' is required. e.g. brew install watchexec or cargo install watchexec" >&2; exit 1; }
if [[ -z $1 || "$1" == "--help" ]]; then
@tednaleid
tednaleid / gist:0982b620a022346a34d24a961c5bb517
Created June 15, 2017 00:29
karabiner 0.91.3 caps lock to ctrl when chorded or esc when pressed alone
// modified from http://brettterpstra.com/2017/06/14/full-hyper-key-functionality-restored-in-sierra/
// this makes caps lock turn into "left control" if pressed with another key
// and "escape" if pressed by itself. Requires karabiner elements 0.91.3 or higher to have
// the "to_if_alone" section. Place after "simple_modifications" in the ~/.config/karabiner/karabiner.json file
"complex_modifications": {
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to command+control+option+shift. Escape if no other key used.",
@tednaleid
tednaleid / gist:c4ed5ec8e047f1adb13c1dd333bbb2e2
Created March 24, 2017 05:29
shell commands for finding and deleting duplicate files based on md5sum of the file
# RUN AT YOUR OWN RISK, UNDERSTAND THE COMMANDS AND DO NOT RUN BLINDLY
This will find all the duplicate photos in a `raw_photos` directory.
create md5sum of all files (after `brew install coreutils`):
find raw_photos -type f -exec gmd5sum "{}" + > files.md5
then sort that and you can find the files where the md5sum (the first field) is repeated for spot-checking and comparison
@tednaleid
tednaleid / .gitconfig
Created March 10, 2017 18:26
`git pusho` command that pushes to origin and creates a clickable link to open a PR using upstream branch as merge target
[alias]
# clickable http link to github repo
repourl=!"echo https://$(git remote get-url --push origin | sed 's/git\\@\\(.*\\)\\.git/\\1/' | sed 's/:/\\//')"
# push out a feature branch with a clickable link for creating a pull request against your upstream origin branch
pusho = !git push origin $(git branchname) && echo "create a pull request at: $(git repourl)/compare/$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} | awk -F'/' '{print $NF}')...$(git branchname)?expand=1"
#! /usr/bin/env groovy
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.groovy.test.embed.GroovyEmbeddedApp
import ratpack.handling.Context
import ratpack.http.client.HttpClient
import ratpack.rx.RxRatpack
import ratpack.service.Service
#! /usr/bin/env groovy
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.groovy.test.embed.GroovyEmbeddedApp
import ratpack.handling.Context
import ratpack.http.client.HttpClient
import ratpack.rx.RxRatpack
import ratpack.service.Service
#! /usr/bin/env groovy
import ratpack.exec.Downstream
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.exec.Promise
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack