Skip to content

Instantly share code, notes, and snippets.

View antoniolg's full-sized avatar

Antonio Leiva antoniolg

View GitHub Profile
@antoniolg
antoniolg / AGENTS.md
Last active September 25, 2026 12:53
Codex: autonomous Luna subagent, per-task reasoning effort, and completion callbacks

Luna delegation for Codex

Add the following section to ~/.codex/AGENTS.md and save the companion luna_worker.toml as ~/.codex/agents/luna_worker.toml.

Luna Delegation

  • Primary agents: proactively delegate bounded, self-contained jobs to luna_worker when Luna can complete and verify them independently and delegation saves work or supervision. Suitable jobs include authorized releases through established procedures, focused web research, long-running scripts, batch processing, and straightforward implementation. Handle small operations directly by default, unless there are long waits, useful independent parallel work, or an explicit user request to delegate.
  • Delegate preparation, execution, and verification as one complete job. Build a concise brief from available context and file references; avoid extra parent tool calls solely to prepare the delegation when that information is sufficient. Leave input inspection, artifact preparation, and routine validation to Luna, except where the parent n
@antoniolg
antoniolg / jev_server.py
Created September 18, 2026 13:35
Jev Codex Router server with configurable Luna policy and adaptive effort
#!/usr/bin/env python3
"""Jev Codex Router — local server on 127.0.0.1:4319 for the Codex Router.
Receives Responses requests destined for the "jev/auto" model (the Codex
Router's "jev" generic provider), asks Jev (TypeSafe System One) for a tier
and a thinking depth, applies the routing policy, then relays to the Codex
Router's local caller edge (native session sharing enabled) — with no format
conversion: Responses in, Responses out, SSE relayed verbatim.
Default routing policy:
@antoniolg
antoniolg / README.md
Created August 4, 2026 09:10
MiniMax H3 fácil: genera vídeos desde Terminal sin instalar dependencias

MiniMax H3 fácil: genera un vídeo sin saber programar

Este pequeño programa pregunta qué vídeo quieres, solicita tu API key sin mostrarla ni guardarla, envía la petición a MiniMax H3 y descarga el MP4 automáticamente.

Antes de empezar

  1. Crea una cuenta en MiniMax Platform.
  2. En Account Management → API Keys, crea una API key.
  3. Añade saldo o créditos a tu cuenta.
  4. Instala Python 3 si todavía no lo tienes.
@antoniolg
antoniolg / PeopleDb.kt
Created July 7, 2020 11:14
Room basic sample in Kotlin
import androidx.room.Database
import androidx.room.RoomDatabase
@Database(
entities = [Person::class],
version = 1
)
abstract class PeopleDb : RoomDatabase() {
abstract fun personDao(): PersonDao
@antoniolg
antoniolg / MainActivity.kt
Last active March 2, 2023 08:10
Shows how to use permissions with registerForActivityResult(). Code for https://devexperto.com/permisos-android-11
import android.Manifest.permission.ACCESS_COARSE_LOCATION
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.provider.Settings
import androidx.activity.ComponentActivity
import androidx.activity.result.contract.ActivityResultContracts.RequestPermission
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
@antoniolg
antoniolg / HomeActivity.kt
Last active April 11, 2024 11:03
Snackbar extensions on Kotlin, to create a useful small DSL.
class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
setSupportActionBar(toolbar)
fab.setOnClickListener {
it.snack("Snack message") {
action("Action") { toast("Action clicked") }
@antoniolg
antoniolg / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layoutfab);
//Outline
int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
Outline outline = new Outline();
@antoniolg
antoniolg / SwipeRefreshActivity.java
Last active July 29, 2019 11:59
An activity that uses a SwipeRefreshLayout as a container for the layout of the classes that extend it.
/*
* Copyright (C) 2014 Antonio Leiva Gordillo.
*
* 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