Skip to content

Instantly share code, notes, and snippets.

View kaigouthro's full-sized avatar

kai gouthro kaigouthro

  • Alberta, Canada
View GitHub Profile
@kaigouthro
kaigouthro / unpack_js_map.py
Created May 24, 2024 03:14
Fastest ever folder of ./index.js.map making for source map to files extractor, quick and dirty.
import json
import os
def extract_source_code(map_file_path):
"""
Extracts source code from a webpack source map file.
Args:
map_file_path (str): Path to the source map file.
Returns:
@kaigouthro
kaigouthro / lua.py
Created January 11, 2024 07:20
logitech_lua_python.py
class LuaScriptGenerator:
def __init__(self):
self.function_templates = {
"PressAndReleaseKey": "PressAndReleaseKey({key})",
"PressKey": "PressKey({key})",
"ReleaseKey": "ReleaseKey({key})",
"PressAndReleaseMouseButton": "PressAndReleaseMouseButton({button})",
"PressMouseButton": "PressMouseButton({button})",
"ReleaseMouseButton": "ReleaseMouseButton({button})",
# Add more function templates as needed
@kaigouthro
kaigouthro / self_taught.py
Created December 23, 2023 10:26
Test Basis for expanding.. The way forward to after AGI starts with a goat path.
from langchain.chains.openai_functions import create_openai_fn_runnable
from langchain.chat_models import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
def create_prompt(settings):
instructions = generate_instructions(settings)
current_settings = generate_current_settings(settings)
return instructions, current_settings
@kaigouthro
kaigouthro / streamsnc_reference.md
Last active September 17, 2023 19:47
streamsync reference

This list is automatically generated from the framework's source code.

Layout

Components to organise the app's layout. Not meaningful by themselves; their objective is to enhance how other components are presented.

Sidebar

@kaigouthro
kaigouthro / info.md
Created September 5, 2023 06:58
60 second sdxl Dreambooth lora training

step 1.

make sure you have virtualenv

sudo apt install python3-venv
pthon -m pip install virtualenv

step 2.

create a virtualenv

version: '3'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.10
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker
ports:
# The HTTP port
import pandas as pd
import sqlite3
conn = sqlite3.connect('/path/to/where/you/want/to/store/your/db')
c = conn.cursor()
df = pd.DataFrame([{'Column1':'Data','Column2':'Base'}])
df.to_sql("SQLDatabase", conn, if_exists="replace")
@kaigouthro
kaigouthro / Pine_Script_5_Mini_Reference.md
Last active May 29, 2024 03:55
A minimal reference to pine script v5

Pine Script Mini-Reference

This document provides a concise reference for Pine Script, a programming language specifically designed for trading strategies and indicators within TradingView.

Operators

Arithmetic Operators

Operator Description
//@version=5
library("keyed_primatives")
export type float_item
string key = ''
float val = 0.
export type float_dict
float_item[] content
{
"keyords and operators": [
"!=",
"%",
"%=",
"*",
"*=",
"+",
"+=",
"-",