This document explains how OpenCode assembles everything the LLM sees: system prompt, tool definitions, agent configuration, and instruction files. It focuses on what's dynamic and why.
All paths are relative to the repo root.
This ZSH completion script enhances your command line interface by providing auto-completion for the ollama command, part of the Ollama suite. It supports all subcommands and their options, significantly improving efficiency and reducing the need for memorizing syntax.
_ollama script directly using the following command:I have an updated version of this on my blog here: https://chrisamico.com/blog/2023-01-14/python-setup/.
This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.
A Regex (regular Expression) is a snippet of code that is used to extract bits of information from any field of text. It accomplishes this by setting up key parameters to search for within a body of text. A regex is a very powerful tool and can be used in almost all programable languages like JavaScript, Java, VB, Python, and many more!
The regex that we will be looking at in this gist is for hex colors. A hex color is a representation of various colors that follows a specific hexadecimal integer count so it is fairly easy to keep track of. The regex to search for a hex color code will be: ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$. Bellow we will break apart the different parts of this regex so that we can better understand what is being shown.
| import sublime | |
| import sublime_plugin | |
| import re | |
| def plugin_loaded(): | |
| """ | |
| When the plugin loads, set up to monitor the user preferences changing so | |
| that we can change tab colors on settings change. |
| language | url | |
|---|---|---|
| 'Are'are language | https://en.wiktionary.org/wiki/Category:%27Are%27are_language | |
| A'ou language | https://en.wiktionary.org/wiki/Category:A%27ou_language | |
| A-Hmao language | https://en.wiktionary.org/wiki/Category:A-Hmao_language | |
| A-Pucikwar language | https://en.wiktionary.org/wiki/Category:A-Pucikwar_language | |
| Aari language | https://en.wiktionary.org/wiki/Category:Aari_language | |
| Aasax language | https://en.wiktionary.org/wiki/Category:Aasax_language | |
| Aba language | https://en.wiktionary.org/wiki/Category:Aba_language | |
| Abaga language | https://en.wiktionary.org/wiki/Category:Abaga_language | |
| Abai language | https://en.wiktionary.org/wiki/Category:Abai_language |
| /** Helping function used to get all methods of an object */ | |
| const getMethods = (obj) => Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(item => typeof obj[item] === 'function') | |
| /** Replace the original method with a custom function that will call our aspect when the advice dictates */ | |
| function replaceMethod(target, methodName, aspect, advice) { | |
| const originalCode = target[methodName] | |
| target[methodName] = (...args) => { | |
| if(["before", "around"].includes(advice)) { | |
| aspect.apply(target, args) |
brew install microsoft-edge --cask
| // based on https://github.com/blockstack/blockstack-core/blob/ff86948ed2f720824cd5e6ece6a63aaaf2bf81ff/blockstack/lib/b40.py | |
| class B40 { | |
| constructor() { | |
| this.B16_CHARS = '0123456789abcdef' | |
| this.B40_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz-_.+' | |
| } | |
| divmod(x, y) { | |
| const div = x / y | |
| const rem = x % y |