Skip to content

Instantly share code, notes, and snippets.

View kaigouthro's full-sized avatar
🔍
Looking For Work

kai gouthro kaigouthro

🔍
Looking For Work
  • Alberta, Canada
View GitHub Profile
@kaigouthro
kaigouthro / docs.md
Last active August 16, 2025 23:55
Install Docker to Mounted Drive

A Bash script for Debian/Ubuntu-based systems that will install Docker (if not already installed) and configure it to use a specified directory (presumably on your mounted external drive) for storing containers, images, volumes, etc.

Important Considerations BEFORE Running:

  1. External Drive MUST be Mounted: This script assumes your external drive is already mounted before you run the script. It does not handle mounting the drive itself.
  2. Persistent Mount: For Docker to start correctly after a reboot, the external drive must be mounted persistently (e.g., via an entry in /etc/fstab) at the same path every time.
  3. Backup: If you have existing Docker data in /var/lib/docker and it's important, BACK IT UP before running this script. The script attempts to move existing data, but failures can happen.
  4. Root Privileges: You need to run this script with sudo.
  5. Distribution: This script is tailored for Debian/Ubuntu. The package manager (apt), repository s
@tvst
tvst / state_class_patch.py
Last active February 4, 2025 11:53
An alternative API for st.session_state using a class decorator.
"""An alternative API for st.session_state using a class decorator.
So instead of doing this...
if "run_counter" in st.session_state:
st.session_state.run_counter = 0
st.session_state.run_counter += 1
st.write("Number of reruns:", st.session_state.run_counter)
@kaigouthro
kaigouthro / Pine_Script_5_Mini_Reference.md
Last active July 20, 2025 14:31
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
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")