Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env zsh -ex
# Check that current working directory is inside a git project, and cd to the root directory
git rev-parse --verify HEAD > /dev/null
cd "$(git rev-parse --show-toplevel)"
# Add project to Rails MCP server configuration if not already present
project_name="${PWD:t}"
grep "^${project_name}:" "$HOME/.config/rails-mcp/projects.yml" || echo "${project_name}: \"$(pwd)\"" >> "$HOME/.config/rails-mcp/projects.yml"
@jadatkins
jadatkins / aliases.zsh
Last active September 16, 2025 12:01
oh-my-zsh custom aliases
eval "$(gh copilot alias -- zsh)"
alias awslogin='aws sso login --sso-session aws'
alias ccstatusline='npx ccstatusline@latest'
alias claude='ASDF_NODEJS_VERSION=$(asdf latest nodejs) npx -y @anthropic-ai/claude-code "$@"'
alias gemini='ASDF_NODEJS_VERSION=$(asdf latest nodejs) GEMINI_API_KEY="*****" npx -y @google/gemini-cli "$@"'
alias gitlog='git log --reverse --oneline origin/$(git_main_branch)~1..HEAD' # git_main_branch is defined in oh-my-zsh git plugin
alias ff-main='gfa && git merge-base --is-ancestor main origin/main && git fetch origin main:main'
@jadatkins
jadatkins / find_center.py
Created June 27, 2025 13:36
Python script to find the centre of mass of a black-and-white shape
#!/usr/bin/env python3
import numpy as np
from scipy import ndimage
import matplotlib.image as mpimg
import sys
import os
def print_usage_and_exit():
@jadatkins
jadatkins / find_center.py
Created May 7, 2025 15:54
Find and mark the centre of mass of a black shape in an image
#!/usr/bin/env python3
import numpy as np
from scipy import ndimage
import matplotlib.image as mpimg
import sys
import os
def print_usage_and_exit():
@jadatkins
jadatkins / index.js
Created September 23, 2015 12:57
/usr/local/lib/node_modules/travis-notify-geckoboard/node_modules/questor/index.js
'use strict';
var assign = require('lodash.assign');
var defaults = require('lodash.defaults');
var bl = require('bl');
var http = require('http');
var https = require('https');
var Promise = require('bluebird');
var url = require('url');