Skip to content

Instantly share code, notes, and snippets.

View SynapticSage's full-sized avatar
🏗️
🏗️

Ryan Young SynapticSage

🏗️
🏗️
View GitHub Profile
@SynapticSage
SynapticSage / avante.lua
Last active February 11, 2026 21:44
ryoung's avante config
local function build_provider_config(config, template)
local provider = vim.tbl_deep_extend("force", {}, template)
-- Override with specific config
provider.model = config.model
if config.extra_request_body then
provider.extra_request_body = vim.tbl_deep_extend("force",
provider.extra_request_body or {}, config.extra_request_body)
end
@SynapticSage
SynapticSage / icloud_blacklist_folder.sh
Last active September 16, 2024 21:50
I find it wildly annoying that icloud removes files from certain org/ folders. I wanted a short utility that would allow me to blacklist a folder by refreshing the need to hold a file locally every $HEARTBEAT seconds. There is probably a better way to do this, but a short simple fix that doesn't cost much read time.
#!/bin/bash
#
# A utility to keep iCloud/Dropbox files local by periodically accessing them every $HEARTBEAT seconds.
# Define the function
keep_files_local() {
local folder_path="$1"
local heartbeat="${2:-500}"
# Check if folder path and heartbeat are provided
pbappend() {
# Get the current clipboard contents
current_clipboard=$(pbpaste)
# Append the provided argument text
new_clipboard="${current_clipboard}$1"
# Copy the new string back to the clipboard
echo "$new_clipboard" | pbcopy
}
@SynapticSage
SynapticSage / zpy.sh
Created July 29, 2024 04:49
the Z commandline tool, but if we hit a python venv folder, automatically source it
#!/usr/bin/env bash
zpy() {
if [ -z "$1" ]; then
echo "Usage: zpy <directory>"
return 1
fi
# Run `z` on the given directory and capture the target directory
z "$1"
@SynapticSage
SynapticSage / TaskEnvironment.py
Last active July 29, 2024 04:51
task_environ_from_private_repo.py
# Environments that implement tasks
# -----# -----# -----# -----# ----------
#
# Key OpenAI Gym defines:
# (1) step()
# (2) reset()
import warnings
import pandas as pd
import numpy as np
@SynapticSage
SynapticSage / clip_magic.py
Last active March 4, 2021 07:18 — forked from eXenon/clip_magic.py
Python3 compatible copy-to-clipboard magic for IPython
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
Example usage:
%clip hello world
# will store "hello world"
a = [1, 2, 3]
%clip a
# will store "[1, 2, 3]"