Skip to content

Instantly share code, notes, and snippets.

@gurdiga
gurdiga / .ABOUT.md
Last active May 2, 2026 19:43
Apple Health sleep cycle analysis

Health Data

Apple Health exports and analysis scripts.

Contents

  • apple_health_export/ — Apple Health export (XML + clinical records)
  • sleep_cycles.py — Parses sleep data and prints nightly sleep cycles
  • Makefile — Convenience targets
  • export.zip — Original export archive (Health app → profile picture → Export All Health Data)
@gurdiga
gurdiga / .ABOUT.md
Last active April 30, 2026 18:49
Claude Code skill: profile individual tool-call durations via the built-in OpenTelemetry console exporter

claude-tool-profiling

A Claude Agent Skill that measures how long individual Claude Code tool calls take — Bash, Edit, MCP tools, everything.

It uses Claude Code's built-in OpenTelemetry instrumentation with the console exporter, so no Docker collector or observability backend is needed. Spans land in stdout, a small awk pipeline extracts tool.execution durations.

Why

When you're scripting lots of tiny tool calls, it helps to know the per-call floor. For example, the benchmark below shows that Bash "echo hello" has an overhead ~20× higher than an MCP stdio tool — which changes how you'd design a multi-step workflow.

@gurdiga
gurdiga / README.md
Last active January 29, 2026 20:37
Quick-edit “Pencil” link for Blogspot.
@gurdiga
gurdiga / CLAUDE.local.md
Created November 28, 2025 11:29
Personal Claude Code Guidelines

Pull Request Guidelines

When creating PRs:

  1. Create as draft PR (gh pr create --draft)
  2. Assign to the user (--assignee @me)
  3. Add the "🌟 NEW FEATURE" label (--label "🌟 NEW FEATURE")
  4. Do not hard-wrap long Markdown text lines in PR descriptions
  5. Do not include Co-Authored-By: Claude line in PR descriptions (co-authorship is already mentioned in commits)
@gurdiga
gurdiga / aes-encryption-example.md
Last active May 9, 2023 13:50
JS AES encryption example.

JS AES encryption example

This is a quick example of how to get symmetric encryption in JS using [aes.js from the crypto-js project][1]:

// at this point http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js should be loaded

var data = 'a JSON blob or something',
    password = 'my long and very secretive passphrase';

var encrypted = CryptoJS.AES.encrypt(data, password).toString();

@gurdiga
gurdiga / app.js
Last active January 3, 2022 14:37
Google App Script
/*
1. Check if there are any new messages with “DMARC Reports” label in my GMail, and
2. if yes, then get the attached file and put it in the “DMARC Reports” folder in my GDrive.
3. Then send me an email with a report about what happened.
*/
// GmailApp: https://developers.google.com/apps-script/reference/gmail/gmail-app
// DriveApp: https://developers.google.com/apps-script/reference/drive/drive-app
@gurdiga
gurdiga / Makefile
Last active June 7, 2020 12:05
PhotoBucket export
.ONESHELL:
MAKEFLAGS=
export CURL_PARAMS=--silent --connect-timeout 5 --retry-delay 0 --retry 5
start: list-albums # download-photos
list-albums:
@function main() {
list_albums "/albums/c111/SandraDodd"

Per-directory Bash history (w/o aliasing cd)

I use Bash’s PROMPT_COMMAND variable:

The value of the variable PROMPT_COMMAND is examined just before Bash prints each primary prompt. If PROMPT_COMMAND is set and has a non-null value, then the value is executed just as if it had been typed on the command line.

The source code should be pretty straight forward, but if not, please ask in the comments. Put this in your .bashrc or similar:

# per-directory Bash history
@gurdiga
gurdiga / optimizely.mk
Created August 16, 2019 10:37
The Makefile I used to mangle some Optimizely logs
default:
Make what?
sync: download upload
download:
time aws --profile mx-optimizely s3 sync s3://optimizely-export-ng/10629356/10629356/2.0/2019/08/14/ 2019/08/14/
download-day:
test -z "$(DAY)" && (echo "Give me a DAY, please. Something like DAY=08/21." && exit 1) || \
@gurdiga
gurdiga / export-notes-to-plain-text.scpt
Created July 23, 2019 01:40
Export Apple Notes to plain text
tell application "Notes"
repeat with eachNote in notes in folder "Log"
tell eachNote
set content to body as text
set {year:y, month:m, day:d, hours:h, minutes:n} to creation date
set m to m as number
set d to d as number
set n to n as number
set h to h as number