This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Environments that implement tasks | |
| # -----# -----# -----# -----# ---------- | |
| # | |
| # Key OpenAI Gym defines: | |
| # (1) step() | |
| # (2) reset() | |
| import warnings | |
| import pandas as pd | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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]" |