Skip to content

Instantly share code, notes, and snippets.

View ahundt's full-sized avatar

Andrew Hundt ahundt

View GitHub Profile
@semikolon
semikolon / README.md
Created August 5, 2025 22:11
Claude Code + Serena MCP Auto-Wrapper - Zero-config per-project Serena instances

Claude Code + Serena MCP Auto-Wrapper

Zero-configuration automatic Serena MCP server management for Claude Code

Transparently starts exactly one Serena instance per project with unique ports. No per-project setup required!

✨ Features

  • Zero Configuration: Just run claude - Serena starts automatically
  • Per-Project Isolation: Each project gets its own Serena instance on unique ports (9000+)
@masuidrive
masuidrive / claude-sandbox.sb
Last active September 2, 2025 23:25
Claude Code CLIをmacOSのsandbox-execで動かす方法
; このファイルを `~/.claude/claude-sandbox.sb` に設定したあと、
; alias c="sandbox-exec -f ~/.claude/claude-sandbox.sb -D PWD="`pwd`" -D HOME="$HOME" claude "
; このaliasを~/.zshrcに書き込んで、`. ~/.zshrc`で読み直します。
; dangerousな人は下記のように。
; alias c="sandbox-exec -f ~/.claude/claude-sandbox.sb -D PWD="`pwd`" -D HOME="$HOME" claude --dangerously-skip-permissions "
; これで `c`だけで安全にClaude Code CLIが実行できます。
(version 1)
; based
@boxabirds
boxabirds / .cursorrules
Last active October 29, 2025 23:48
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors
@rmcelreath
rmcelreath / prior_likelihood_conflict.r
Created September 11, 2023 11:29
Demonstration of how normal and student-t distributions interact in Bayesian updating
# prior - likelihood conflict
library(rethinking)
yobs <- 0
mtt <- ulam(
alist(
y ~ dstudent(2,mu,1),
mu ~ dstudent(2,10,1)
@idleberg
idleberg / vscode-macos-context-menu.md
Last active August 9, 2025 21:46
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@guilhermepontes
guilhermepontes / readme.md
Last active November 27, 2022 21:02
Get the old VSCode back on macOS

Get the old VSCode icon back!! 🔥 🔥

First download the new old icon: https://cl.ly/mzTc (based on this)

You can also use the icon you want, but you need to convert it to .icns. You can use this service to convert PNG to ICNS.

Go to Applications and find VSCode, right click there and choose Get Info. Drag 'n drop the new icon.

class weighted_categorical_crossentropy:
def __init__(self, weights):
self.weights = weights
self.__name__ = 'wcentroid_loss'
def __call__(self, y_true, y_pred):
class0 = K.ones_like(y_pred)[:, :, :, 0] * self.weights[0]
class1 = K.ones_like(y_pred)[:, :, :, 0] * self.weights[1]
x = K.tf.where(y_true[:, :, :, 0] > 0, class0, class1)
result = x * K.categorical_crossentropy(y_pred, y_true)
@eldar
eldar / tf-resnet-fcn.py
Last active September 11, 2017 06:20
import datetime as dt
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.contrib.slim.nets import resnet_v1
import threading
from PoseDataset import PoseDataset
from TrainParams import TrainParams
import tensorflow as tf
from tensorflow.python.framework import ops
import numpy as np
# Define custom py_func which takes also a grad op as argument:
def py_func(func, inp, Tout, stateful=True, name=None, grad=None):
# Need to generate a unique name to avoid duplicates:
rnd_name = 'PyFuncGrad' + str(np.random.randint(0, 1E+8))
@kastnerkyle
kastnerkyle / pascalvoc.py
Last active June 4, 2018 21:41
Wrapper to read pascal voc data
# Author: Kyle Kastner# License: BSD 3-Clause# For a reference on parallel processing in Python see tutorial by David Beazley# http://www.slideshare.net/dabeaz/an-introduction-to-python-concurrency# Loosely based on IBM example# http://www.ibm.com/developerworks/aix/library/au-threadingpython/# If you want to download all the PASCAL VOC data, use the following in bash..."""#! /bin/bash# 2008wget http://host.robots.ox.ac.uk/pascal/VOC/voc2008/VOCtrainval_14-Jul-2008.tar# 2009wget http://host.robots.ox.ac.uk/pascal/VOC/voc2009/VOCtrainval_11-May-2009.tar# 2010wget http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar# 2011wget http://host.robots.ox.ac.uk/pascal/VOC/voc2011/VOCtrainval_25-May-2011.tar# 2012wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar# Latest devkitwget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCdevkit_18-May-2011.tar"""try: import Queueexcept ImportError: import queue as Queueimport threadingimport ti