Skip to content

Instantly share code, notes, and snippets.

View itsbrex's full-sized avatar
🎯
focusing

Brian Roach itsbrex

🎯
focusing
View GitHub Profile
@disler
disler / README.md
Created March 31, 2024 14:34
Use these Prompt Chains to build HIGH QUALITY AI Agents (Agentic Building Blocks)

Setup

  1. Create a new directory with these three files (requirements.txt, main.py, README.md)
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python main.py
  6. Update main() to run the example prompt chains
@itsbrex
itsbrex / building-sync-systems.md
Created February 5, 2024 06:43 — forked from pesterhazy/building-sync-systems.md
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@adrianhorning08
adrianhorning08 / index.js
Created January 5, 2024 23:35
Create CSV on frontend
export function createCSV(data, fileName) {
const headers = Object.keys(data[0]);
const csvContent = [
headers.join(","),
...data.map((row) =>
headers
.map((header) => {
const value = row[header];
if (value === null) return "null";
@nberlette
nberlette / hook.ts
Last active February 5, 2024 06:42
`Hook`: git hooks integration with Deno's task runner
const TASK_NAME_REGEXP = /^[a-z\^\$][a-z0-9\-_$:.\^]*$/i;
type TaskConfig = { [key: string]: string };
type HooksConfig<K extends MaybeHookNames = Hook.Name> = {
readonly [P in K]: string | string[];
};
type HookNames = typeof Hook.names[number];
type strings = string & { __strings__?: never };
@jbflow
jbflow / read_live_logs.py
Created December 14, 2023 02:21
Reads the Ableton log.txt file continuously and outputs all Remote Script related messages. Takes the live version as an argument. Needs Python 3 installed to run
#!/usr/bin/python3
# Reads Live logs in log.txt, supply with live version as argument
# chmod +x read_live_logs.py
# sudo cp read_live_logs.py /usr/local/bin
# Create an alias for quicker useage
# cd ~/.
# vim .zshrc
# Press i
# alias rll="read_live_logs.py"
# Press Esc
@jbflow
jbflow / copy_remote_script.sh
Last active December 14, 2023 05:10
Copies a MIDI Remote Script from a working git repo into Ableton Lives Remote Scripts folder in the User library. Creating folders as necessary, excluding .git repo and has overwrite protection.
#!/bin/sh
# Run the following commands to add to your terminal
# sudo cp copy_remote_script.sh /usr/local/bin
# cd /usr/local/bin
# chmod +x copy_remote_script.sh
# now from your remote script directory you can run 'sh copy_remote_script.sh . <SCRIPTNAME>' And it will do everything for you.
# If you want to shorten it you can add an alias
# cd ~/.
# vim .zshrc
@jart
jart / rename-pictures.sh
Created December 12, 2023 15:24
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <jtunney@gmail.com>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
@mutoo
mutoo / get_source_map_links.js
Last active March 18, 2024 16:23
Get all source map links on page. Usage: create a snippet on `chrome devtools > sources > snippets` and run it.
@ruihe774
ruihe774 / myguesslang_convert.py
Last active March 1, 2024 18:48
Convert guesslang model to onnx
# %%
import tensorflow as tf
tf.config.set_visible_devices([], 'GPU')
# %%
model = tf.saved_model.load("model")
predict = model.signatures["predict"]
# %%
class HyperParameter:
@disler
disler / prompt-generate-python-class.txt
Last active May 1, 2024 20:43
Python Class Generator Prompt
Create a python class that enables <objective>. I need the following FUNCTION support.
FUNCTION
__init__()
func1()
func2(with_param)
func3(with_param) - explanation of function