by Glenn Matlin / glennmatlin on all socials
- Download and copy all files in this gist to
~/.claude/ - Move the
.pyfiles to~/.claude/hooks - Restart Claude Code.
This is a drop-in, zero-config Actions harness for OpenAI's Codex agent. It uses GitHub Models for inference, so you don't need to set up any secrets - just copy-pasting the action into your repo should work as-is.
You may need to go into your settings and check the "allow Actions to open PRs" checkbox.
To use it, open an issue in your repo with [codex] in the issue name.
Note: I've updated this to work for the latest version of Codex (the Rust one). If you're using the Python one, you'll have to go to a previous version of this Gist.
| # Train GPT-2 in five minutes -- for free | |
| # | |
| # ```bash | |
| # pip install modal | |
| # modal setup | |
| # modal run wrapper.py | |
| # ``` | |
| # | |
| # Note that the end-to-end latency the first time is more like 25 minutes: | |
| # - five minutes to install Torch (rip) |
| #!/usr/bin/env bb | |
| (ns vidwiz.main | |
| "This is a prototype script for automating a portion of my video editing using ffmpeg." | |
| (:require [clojure.java.shell :refer [sh]] | |
| [clojure.string :as st] | |
| [cheshire.core :refer [parse-string]])) | |
| ;; util | |
| (defn get-extension |
| #!/usr/bin/awk -f | |
| # This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff | |
| # My copy here is written in awk instead of C, has no compelling benefit. | |
| # Public domain. @thingskatedid | |
| # Run as awk -v x=xyz ... or env variables for stuff? | |
| # Assumptions: the data is evenly spaced along the x-axis | |
| # TODO: moving average |
| import fs from "fs" | |
| import path from "path" | |
| import { inspect } from "util" | |
| const { Console } = console | |
| const makeFile = (name = "result") => fs.createWriteStream(path.join(__dirname, `../${name}.log`)) | |
| const inspectOptions = { maxArrayLength: null, depth: null } |
| // create a bookmark and use this code as the URL, you can now toggle the css on/off | |
| // thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
| javascript: (function() { | |
| var domStyle = document.createElement("style"); | |
| domStyle.append( | |
| '* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\ | |
| * * { background-color: rgba(0,255,0,.2) !important; }\ | |
| * * * { background-color: rgba(0,0,255,.2) !important; }\ | |
| * * * * { background-color: rgba(255,0,255,.2) !important; }\ | |
| * * * * * { background-color: rgba(0,255,255,.2) !important; }\ |
| /** | |
| `useChangeLog` - dev-mode helper hook to let you | |
| know why a memoized component re-rendered! | |
| Usage example: | |
| const YourComponent = React.memo((props) => { | |
| // Just drop this fella into your memo component's body. | |
| useChangeLog(props); |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| import { h, Component } from 'preact'; | |
| import Markup from 'preact-markup'; | |
| import register from './preact-custom-element'; | |
| // just a proxy component: WC -> Preact -> WC | |
| const A = () => <x-b foo="initial foo from <x-a>" />; | |
| // stateful component that can re-render | |
| class B extends Component { | |
| render(props, state) { |