Skip to content

Instantly share code, notes, and snippets.

View chrisbanes's full-sized avatar

Chris Banes chrisbanes

View GitHub Profile
@chrisbanes
chrisbanes / AGENTS.md
Last active October 5, 2026 09:15
Subagent guidance for Codex (copy the raw contents into your ~/.codex/AGENTS.md)

Subagent model and reasoning selection

Use this guidance whenever launching any subagent, regardless of role.

Before every launch, follow the flow below to choose the model and reasoning effort together. Set both explicitly in the spawn call. Apply the flow again for each new assignment; do not automatically reuse a previous selection.

Classify the assignment after scoping it: choose for the work delegated now.

@chrisbanes
chrisbanes / SKILL.md
Created September 21, 2026 14:50
Vinted Listings Skill
name vinted-listings
description Create Vinted listings from item photos, or audit and improve existing listings. Use for Vinted selling workflows involving photo grouping, accurate listing copy, retail-price checks, uploads, and saved-listing verification.

Vinted listings

Turn the user's photos and item facts into accurate, searchable Vinted listings, and carry authorized changes through to verified saved results. Use the current browser-control tool and its documentation; prefer an available dedicated integration if it actually supports the task.

Establish the items and scope

@chrisbanes
chrisbanes / Sample.kt
Last active April 23, 2024 11:40
Compose Multiplatform UIViewController with transparent background
fun myUIViewController(
content: @Composable () -> Unit,
): UIViewController = ComposeUIViewController {
val controller = LocalUIViewController.current
DisposableEffect(controller) {
controller.forceTransparentBackground()
onDispose { /* no-op */ }
}
// Rest of your Compose code
@chrisbanes
chrisbanes / moved.txt
Last active February 18, 2023 10:43
A prototype #JetpackCompose Painter which draws an Android Drawable
This is now available at https://google.github.io/accompanist/drawablepainter/
Moved to https://google.github.io/accompanist/insets/
@chrisbanes
chrisbanes / bash_aliases
Created March 30, 2020 13:23
Shell function to set default JDK to Android Studio's bundled JDK
function set-studio-jdk() {
export JAVA_HOME=$1/Contents/jre/jdk/Contents/home/
}
@chrisbanes
chrisbanes / themes.xml
Last active May 6, 2022 03:48
edge_to_edge_legacy_theme
<!-- values/themes.xml -->
<style name="Theme.MyApp">
<item name="android:navigationBarColor">
#B3FFFFFF
</item>
</style>
<!-- values-night/themes.xml -->
<style name="Theme.MyApp">
<item name="android:navigationBarColor">
@chrisbanes
chrisbanes / ScopedViewModel.kt
Last active March 20, 2025 17:42
ScopedViewModel
open class ScopedViewModel : ViewModel() {
private val job = Job()
protected val scope: CoroutineScope = job + Dispatchers.Main
override fun onCleared() {
super.onCleared()
job.cancel()
}
}
@chrisbanes
chrisbanes / CoroutineLifecycleObserver.kt
Last active September 9, 2022 14:07
LifecycleObserver which allows easy cancelling of coroutines
/*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@chrisbanes
chrisbanes / Animators.kt
Last active March 7, 2024 11:13
Material Image Loading treatment for Android
/*
* Copyright 2018 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software