Skip to content

Instantly share code, notes, and snippets.

#
# This example script will generate a QR code & update a notion page when a webhook is received
# It expects a folder "qr-codes" in the same directory as the script
# It expects the column in the notion page that houses the QR code to be titled "QR Code"
# This is designed to listen to webhooks & serve requests from behind an ngrok tunnel
#
#
# requirements.txt content:
#fastapi==0.115.6
#uvicorn~=0.34.0
@johnsosoka
johnsosoka / andrew_langchain_self_critique.py
Created November 8, 2023 14:22
sketching out simple chain for having agents provide feedback to each other in a langchain chain
import streamlit as st
from langchain.llms import TextGen
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
import time
from langchain.chains import LLMChain, SimpleSequentialChain
from langchain import PromptTemplate
from langchain.globals import set_debug
# ANDREW -- This setting increases the log output of langchain for debug puposes. Flip to False to reduce the log output.
@johnsosoka
johnsosoka / cleanup-files.sh
Created August 28, 2023 03:05
desktop/downloads file cleanup
#!/bin/bash
# Define the Desktop path
DESKTOP_PATH="/Users/john/Desktop"
DOWNLOADS_PATH="/Users/john/Downloads"
# Path for Backup Dirs
BACKUPS_PATH="/Users/john/backups"
# Get the current date in YYYY-MM-DD format
@johnsosoka
johnsosoka / kill_jekyll.sh
Created August 22, 2023 02:44
kills jekyll...or whatever is running on port 4000
#!/bin/bash
# Find the process ID of Jekyll running on port 4000
jekyll_pid=$(lsof -i tcp:4000 -t)
# Check if the process ID is found
if [ -n "$jekyll_pid" ]; then
echo "Jekyll is running with PID $jekyll_pid. Killing the process..."
# Kill the process
@johnsosoka
johnsosoka / deploy.sh
Last active July 14, 2023 20:18
the old johnsosoka.com deploy script.
#!/usr/bin/env zsh
export AWS_PROFILE=jscom
# Author: john sosoka
#
# This script builds the website via Jekyll, syncs the generated artifacts to S3 and invalidates cloudfront distributions.
#
# Usage: ./deploy.sh stage | prod
#
# Set the required environment variables in your rc file.