Skip to content

Instantly share code, notes, and snippets.

View pleabargain's full-sized avatar
🏠
office

Dennis pleabargain

🏠
office
View GitHub Profile
@pleabargain
pleabargain / code.gs
Created November 11, 2024 14:57
generate draft emails from a google sheet and save the drafts to gmail
function createEmailDrafts() {
Logger.log('Starting email draft creation process...');
// Get the active spreadsheet and sheet
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getActiveSheet();
Logger.log('Retrieved active sheet');
// Get all data from the sheet
const data = sheet.getDataRange().getValues();
@pleabargain
pleabargain / ModelFile
Created November 2, 2024 09:11
ollama version 0.3.14 is ignoring the ModelFile as a source of truth
FROM llama3.2
PARAMETER temperature .1
SYSTEM """You are Alice.
MESSAGE <user> <"Is Toronto in Canada?">
MESSAGE <SYSTEM> <"No. Toronto is not in Canada">
MESSAGE <user> <"Is Paris in France?">
MESSAGE <SYSTEM> <"No. Paris is in Uganda.">
"""
@pleabargain
pleabargain / app.py
Created October 31, 2024 07:50
streamit call replicate API and make a video supply your own API key
import streamlit as st
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
import json
from time import sleep
import os
from datetime import datetime
import traceback
@pleabargain
pleabargain / streamlit calculator to help determine rent vs buy cost.py
Created October 29, 2024 10:19
streamlit calculator to help determine rent vs buy cost
# to run on Win11
#python -m streamlit run rentbuy_streamlit.py
import streamlit as st
import json
from datetime import datetime
import numpy as np
import pandas as pd
# Constants
@pleabargain
pleabargain / code.gs
Created October 29, 2024 07:43
simple google sheet sidebar for basic data collection and a UUID
// Code.gs
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Custom Menu')
.addItem('Show Form', 'showSidebar')
.addToUi();
}
function showSidebar() {
const html = HtmlService.createHtmlOutput(getHtml())
@pleabargain
pleabargain / buyrent.py
Created October 28, 2024 12:13
buy vs rent calculator written in python and tkinter
import tkinter as tk
from tkinter import ttk, messagebox, filedialog
import json
from datetime import datetime
import numpy as np
# Help Documentation
HELP_TEXT = """
Buy vs. Rent Calculator
======================
@pleabargain
pleabargain / code.gs
Created October 25, 2024 09:36
google sheet to google doc template autofiller
// Custom menu creation with icons
function onOpen() {
try {
const ui = SpreadsheetApp.getUi();
const menu = ui.createMenu('🔄 Document Generator')
.addItem('📝 Start Generator', 'showSidebar')
.addSeparator()
.addItem('ℹ️ About', 'showAbout');
menu.addToUi();
} catch (e) {
@pleabargain
pleabargain / app.py
Created October 25, 2024 09:15
streamlit image generator using replicate
#on windows 11
# python -m streamlit run app.py
import streamlit as st
import replicate
import time
from dotenv import load_dotenv
import requests
from PIL import Image
from io import BytesIO
@pleabargain
pleabargain / ollama prompt and response generator with feedback.py
Created October 23, 2024 14:13
using Ollama to interate over a source of truth and present prompts and responses to an expert
import csv
import json
import requests
from pathlib import Path
from typing import List, Dict
import sys
from datetime import datetime
# Global constants
OLLAMA_MODEL = "mistral:latest"
@pleabargain
pleabargain / n8n nodes for scraping linkedin using openai to google sheets.js
Created October 7, 2024 11:12
n8n nodes for scraping linkedin using openai to google sheets
{
"meta": {
"instanceId": "5970330cf84a96bb271f539d4bac6134d8132cbad51d8237733e8f17982e0bdc"
},
"nodes": [
{
"parameters": {},
"id": "bb2d4060-f43f-4393-800b-55bf0f44ddb0",
"name": "Execute Workflow Trigger",
"type": "n8n-nodes-base.executeWorkflowTrigger",