Skip to content

Instantly share code, notes, and snippets.

View nevyn's full-sized avatar

Nevyn Bengtsson nevyn

View GitHub Profile
@nevyn
nevyn / README.md
Last active October 5, 2026 17:51
api-tour: a Claude Code mod that tours the whole mods API (drawing elements, panes, Raster, Image, Client, and every noun on $)

api-tour: a guided tour of Claude Code mods

A Claude Code mod that exercises the whole mods API, so you can see what a mod can draw and do instead of reading about it. Run /tour and step through eight tabs: every drawing element, hover effects, form controls, a 10 fps pixel animation, a Julia set drawn as an image, a tiny paint program running on the drawing thread, and about twenty buttons that each call a different part of the engine.

Image tab in Ghostty: a Julia set from raw RGBA bytes, 5 fps Raster tab in Ghostty: a plasma of half-block cells, 10 fps
The Image tab in Ghostty, drawing a colourful Julia set The Raster tab in Ghostty, drawing a plasma animation and a colour ramp

| Raster tab on desktop: the Svg fallback, animated | Engine tab: one button per

@nevyn
nevyn / coolify
Created April 11, 2026 23:36
coolify — a bash CLI wrapper for Coolify's REST API. Auth via ~/.coolify-token, aliases in ~/.coolify-cli-config. Tested against v4.0.0-beta.472. See https://nevyn.dev/blog/20260411-agent-cli-coolify/
#!/usr/bin/env bash
# coolify — a bash CLI wrapper for Coolify's REST API
#
# Why: the Coolify API has enough sharp edges (field name asymmetries, multiple
# create-app endpoints, JSON payload gymnastics) that wrapping it pays for itself
# after a handful of deployments. This script is what I use on my own Coolify
# instance, with Claude Code agents driving it via SSH.
#
# More context: https://nevyn.dev/blog/20260411-agent-cli-coolify/
#
@nevyn
nevyn / README.md
Last active April 25, 2025 23:03
Github Action for Mac notarized + appstore build + TestFlight + visionOS

GH Actions workflow for Mac and Vision Pro

This is taken from my app koja.works, as an attempt to get full notarized + appstore builds made in a single CI workflow so that I can keep track of all moving parts, without involving Fastlane (which in my experience breaks way too often due to system rubies etc).

Builds for both Mac and visionOS, and the vision file is probably easily extensible to iOS as well (maybe with matrix builds?)

I'm using a self-hosted Mac mini on my desktop, which is why I have to fiddle with PATH etc. I'm doing this because I require metal support during build, which Xcode Cloud does not support.

#include <Cartridge.h>
uint8_t smb2_overworld[] = {
0x56, 0x67, 0x6D, 0x20, 0x5B, 0x69, 0x00, 0x00, 0x61, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x68, 0x00, 0x00, 0x17, 0xD9, 0x21, 0x00, 0xDF, 0x12, 0x00, 0x00, 0x20, 0xCC, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x4F, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
pod 'Lookback'
@nevyn
nevyn / LookbackParticipate.h
Created February 4, 2017 00:01
Participate 1.9.0.2
#import <UIKit/UIKit.h>
@protocol LookbackParticipateDelegate;
NS_ASSUME_NONNULL_BEGIN
/*! @header LookbackParticipate.h
@abstract
Public interface for Lookback Participate, the friendly UX for guiding test particioants
through a research session, be it live, self-guided or in person.
@nevyn
nevyn / LookbackParticipate.h
Created February 3, 2017 07:53
Lookback 1.8.0.1 SDK Beta
#import <UIKit/UIKit.h>
@protocol LookbackParticipateDelegate;
NS_ASSUME_NONNULL_BEGIN
/*! @header LookbackParticipate.h
@abstract
Public interface for Lookback Participate, the friendly UX for guiding test particioants
through a research session, be it live, self-guided or in person.
LBNotificationBanner *banner = [LBNotificationBanner new];
[overlay addSubview:banner];
banner.translatesAutoresizingMaskIntoConstraints = NO;
LBInstallConstraint(banner, Top, Equal, overlay, Top, 1, margin);
LBInstallConstraint(banner, Left, Equal, overlay, Left, 1, margin);
LBInstallConstraint(banner, Right, Equal, overlay, Right, 1, margin);
#define LBGuard(cond, ...) \
BOOL __COND_SUCCESSFUL_AT ## __LINE__ = (cond); \
if(!__COND_SUCCESSFUL_AT ## __LINE__) {\
NSString *failureReason = [NSString stringWithFormat:__VA_ARGS__]; \
NSAssert(NO, @"Guard failed: %@: %@", @#cond, failureReason); \
NSLog(@"Guard failed: %@: %@", @#cond, failureReason);\
} \
if(__COND_SUCCESSFUL_AT ## __LINE__) {}
- (void)appendEncodedSampleBuffer:(CMSampleBufferRef)encodedSampleBuffer addTrimAtStart:(int)trimDuration fromSource:(id)source
{
if(!_hasWrittenTrim) {
GFLog(GFDebug, @"Adding trim to sample buffer from %@", source);
const AudioStreamBasicDescription *asbd = CMAudioFormatDescriptionGetStreamBasicDescription(CMSampleBufferGetFormatDescription(encodedSampleBuffer));
CMSetAttachment(encodedSampleBuffer, kCMSampleBufferAttachmentKey_TrimDurationAtStart, (id)CFAutorelease(
CMTimeCopyAsDictionary(
CMTimeMake(trimDuration, asbd->mSampleRate),
kCFAllocatorDefault