Skip to content

Instantly share code, notes, and snippets.

View daniel-farina's full-sized avatar
🎯
Focused

Daniel Farina daniel-farina

🎯
Focused
View GitHub Profile
@daniel-farina
daniel-farina / TECHNICAL.md
Last active May 30, 2026 22:37
Patching a Custom Theme into the Grok CLI (binary edit walkthrough)

Patching a Custom Theme into the Grok CLI

⚠️ This can break Grok. If you break it, you can reinstall it. This also disables auto-updates. Try at your own risk.

A reproducible, step-by-step walkthrough for recoloring the Grok Build TUI by editing the binary.

Build-specific warning. Every byte offset in this document is for grok 0.2.11, macOS arm64. Do not copy the offsets blindly — a different version puts the colors somewhere else. Step 4 shows how to find them on your build; trust that over the literals here.

Safety. Work on a copy, never the original. Disable auto-update. Keep the rollback (Step 9) handy.

@daniel-farina
daniel-farina / grok-cli-bug-report.md
Created May 21, 2026 01:26
Grok CLI 0.1.212 (darwin-aarch64) fails to launch on macOS 15.7.7 - kernel rejects code signature (load code signature error 2)

Grok CLI 0.1.212 (darwin-aarch64) fails to launch on macOS 15.7.7 - kernel rejects code signature (load code signature error 2)

Summary

The darwin-aarch64 build of the Grok CLI installed by https://x.ai/cli/install.sh is killed by the kernel immediately on launch on macOS 15.7.7 (Sequoia, Apple Silicon). Every invocation - including the grok completions {bash,zsh,fish} calls the installer makes at the end - dies with Killed: 9 before any user code runs. The same happens when invoking grok directly.

Userspace tools say the signature is fine (codesign --verify passes; signed by X.AI Corporation / Team 5Y6N3AJ54S). But the kernel refuses to load the binary, logging load code signature error 2 for every exec attempt. This strongly suggests the binary was signed using a code-signature format produced by the macOS 26 SDK / toolchain that the macOS 15 kernel does not accept, even though LC_BUILD_VERSION advertises minos 11.0.

Environment

@daniel-farina
daniel-farina / gist:bc95e2891de736754182e4c7ec15bfe2
Created May 18, 2026 20:06
Cyberpunk Prompts for Grok Build
Main prompt:
```
<user_query>
# Create an an amazing and detailed cyberpunk city
First create the terrain for the land and other objects around it.... make this very solid and detailed, then add each element one by one, create a task list for each element then work on it and make it as detailed as possible. Take your time on each. Add at least 25 detailed items, each item must be part ofyour task list and you must make each very perfect.
# Three.js
@daniel-farina
daniel-farina / grok_default_system_prompt.txt
Created May 18, 2026 01:14
Grok CLI (grok-build) default system prompt — extracted from binary v0.1.211
You are Grok 4.3 released by xAI in April 2026. You are an autonomous agent that completes software engineering tasks. Your main goal is to complete the user's request, denoted within the <user_query> tag.
You are highly capable and often allow users to complete ambitious tasks that would otherwise be too complex or take too long. You should defer to user judgement about whether a task is too large to attempt.
The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more.
## Task Management
You have access to the todo_write tool to help you manage and plan multi-step tasks. Use this tool for complex work to track progress and give the user visibility into progress.
It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed. See the todo_write tool description for the full input contract and worked exampl
@daniel-farina
daniel-farina / opencode-gemma4-ollama-macos.md
Last active June 2, 2026 15:05
Running OpenCode with Gemma 4 26B on macOS via llama.cpp - fixing tool calling

Running OpenCode with Gemma 4 26B on macOS (via llama.cpp)

As of April 2026, Gemma 4 tool calling is broken in Ollama v0.20.0 (ollama/ollama#15241) - the tool call parser fails and streaming drops tool calls entirely. OpenCode also has issues with local OpenAI-compatible providers (anomalyco/opencode#20669, #20719).

This guide documents a working setup using:

  • llama.cpp (built from source with PR #21326 template fix + PR #21343 tokenizer fix) instead of Ollama
  • OpenCode built from source with PR #16531 tool-call compatibility layer

Tested on macOS Apple Silicon (M1 Max, 32GB) on April 2, 2026.

@daniel-farina
daniel-farina / BADCOIN.md
Last active January 9, 2024 20:50
BadCoin - Veryfing the contract

TWAP (Time Weighted Average Price)

Serving TWAPs for every AMM pool.

A time weighted average price is a function that takes a sequence of (time, price) pairs and returns a price representing an 'average' over the entire time period. Currently, only the arithmetic mean method is implemented.

Example to query TWAP via the LCD API

URL: https://lcd-osmosis.blockapsis.com/osmosis/twap/v1beta1/ArithmeticTwap

{"pools":[{"@type":"/osmosis.gamm.v1beta1.Pool","address":"osmo1mw0ac6rwlp5r8wapwk3zs6g29h8fcscxqakdzw9emkne6c8wjp9q0t3v8t","id":"1","pool_params":{"swap_fee":"0.002000000000000000","exit_fee":"0.000000000000000000","smooth_weight_change_params":null},"future_pool_governor":"24h","total_shares":{"denom":"gamm/pool/1","amount":"276337765129834441908053295"},"pool_assets":[{"token":{"denom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2","amount":"3403611909429"},"weight":"536870912000000"},{"token":{"denom":"uosmo","amount":"31441747711316"},"weight":"536870912000000"}],"total_weight":"1073741824000000"},{"@type":"/osmosis.gamm.v1beta1.Pool","address":"osmo1500hy75krs9e8t50aav6fahk8sxhajn9ctp40qwvvn8tcprkk6wszun4a5","id":"2","pool_params":{"swap_fee":"0.005000000000000000","exit_fee":"0.000000000000000000","smooth_weight_change_params":null},"future_pool_governor":"24h","total_shares":{"denom":"gamm/pool/2","amount":"431625679217796465901905449"},"pool_assets":[{"token":{"denom":"uion","
@daniel-farina
daniel-farina / circle.yml
Last active April 16, 2017 05:24 — forked from rap2hpoutre/circle.yml
Circle CI example for Laravel
machine:
timezone:
Europe/Paris
php:
version: 7.0.3
environment:
ENVIRONMENT: testing
DB_URL: 127.0.0.1