Skip to content

Instantly share code, notes, and snippets.

View kaigouthro's full-sized avatar

kai gouthro kaigouthro

  • Alberta, Canada
View GitHub Profile
@tvst
tvst / state_class_patch.py
Last active July 30, 2023 22:51
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 June 8, 2024 07:16
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")