Skip to content

Instantly share code, notes, and snippets.

View didmar's full-sized avatar

Didier Marin didmar

View GitHub Profile
#!/usr/bin/env zsh
# Multi-project worktree manager with Claude support
#
# ASSUMPTIONS & SETUP:
# - Your git projects live in: ~/projects/
# - Worktrees will be created in: ~/projects/worktrees/<project>/<branch>
# - New branches will be named: <your-username>/<feature-name>
#
# DIRECTORY STRUCTURE EXAMPLE:
# ~/projects/
@gavrilov
gavrilov / readme.md
Last active November 8, 2025 02:47
Obsidian voice recognition with local Whisper model

Obsidian voice recognition with local Whisper model

Install plugin Whisper for Obsidian

plugin's settings:

@mikesager
mikesager / runcmd.md
Created July 20, 2020 04:00
SOLVED: cloud-init runcmd doesn't work

If you've added some runcmd lines to your cloud-init config, and the commands don't seem to be executing, here's a few things you should know:

WTF is going on?

  1. runcmd only has code to "shellify" your strings or array of strings (i.e: turns them into a shell script)
  2. runcmd will only write a shell script into the file /var/lib/cloud/instance/scripts/runcmd
  3. runcmd is part of the cloud_config_modules boot stage
  4. You need to execute that runcmd shell script using the scripts-user module
  5. scripts-user is part of the cloud_final_modules boot stage
from importlib import reload
from types import ModuleType
def rreload(module):
"""Recursively reload a module and all its submodules.
Graph DFS strategy modified from
https://stackoverflow.com/questions/15506971/recursive-version-of-reload
"""
visited = set()
def visit(m):
@ajorg-aws
ajorg-aws / s3cat.py
Last active August 16, 2023 16:24
Quick hack to upload stdin to S3.
#!/usr/bin/env python
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@suhailshergill
suhailshergill / RDDasMonadPlus.scala
Last active February 24, 2019 16:09
having monad instances for RDD like things
object RDDasMonadPlus {
import org.apache.spark.{ SparkContext }
import org.apache.spark.rdd.RDD
import scalaz._
import Scalaz._
import scala.reflect.ClassTag
// RDDMPlus is the type for which we will define the Monad instance. it can be
// constructed from an RDD using the RDDClassTag constructor. this
// implementation is based on insights from
@sloria
sloria / bobp-python.md
Last active December 8, 2025 02:37
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active November 12, 2025 14:52
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@endolith
endolith / frequency_estimator.py
Last active September 9, 2025 15:34
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread