- Create a new directory with these three files (requirements.txt, main.py, README.md)
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.py
- Update
main()
to run the example prompt chains
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.
-
Database in a browser, a spec (Stepan Parunashvili)
What problem are we trying to solve with a sync system?
-
The web of tomorrow (Nikita Prokopov)
This file contains 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
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"; |
This file contains 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
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 }; |
This file contains 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/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 |
This file contains 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/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 |
This file contains 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/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: |
This file contains 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
const scriptTags = Array.from(document.querySelectorAll('script')); | |
const scriptSrcs = scriptTags.map(tag=>tag.src).filter(i=>i); | |
const SOURCE_MAPPING_URL = "//# sourceMappingURL="; | |
const maybeSourceMappingURLs = await Promise.allSettled(scriptSrcs.map(async(src)=>{ | |
const code = await fetch(src).then(resp=>resp.text()); | |
const lastLine = code.split("\n").pop(); | |
if (!lastLine.startsWith(SOURCE_MAPPING_URL)) { | |
throw new Error('This scripts don\'t have sourcemap'); |
This file contains 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
# %% | |
import tensorflow as tf | |
tf.config.set_visible_devices([], 'GPU') | |
# %% | |
model = tf.saved_model.load("model") | |
predict = model.signatures["predict"] | |
# %% | |
class HyperParameter: |
This file contains 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
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 |
NewerOlder