Skip to content

Instantly share code, notes, and snippets.

View abfo's full-sized avatar
☁️
Working on an LLM experiment called https://shopstories.us/

Robert Ellison abfo

☁️
Working on an LLM experiment called https://shopstories.us/
View GitHub Profile
@abfo
abfo / OpenAIModelMonitor.gs
Last active May 31, 2025 17:32
Google Apps Script to send an alert when a new OpenAI model is available. Instructions at https://ithoughthecamewithyou.com/post/get-an-email-when-a-new-openai-model-is-available-via-the-api
var AlertEmail = '';
var OpenAIAPIKey = '';
function main() {
// we store known models in script properties
var scriptProperties = PropertiesService.getScriptProperties();
var currentProps = scriptProperties.getProperties();
var anythingNew = false;
var newText = '';
import os
from todoist_api_python.api import TodoistAPI
from openai import OpenAI
import numpy as np
# Todoist palette colors from https://developer.todoist.com/api/v1#tag/Colors
colors = [
{"id": 30, "name": "berry_red", "hex": "#B8255F"},
{"id": 31, "name": "red", "hex": "#DC4C3E"},
{"id": 32, "name": "orange", "hex": "#C77100"},
@abfo
abfo / Program.cs
Created March 11, 2025 23:49
Process photos for a digital frame using face aware cropping and image embeddings to pair similar vertical photos.
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Formats.Jpeg;
using FaceAiSharp;
using System.Numerics.Tensors;
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
const string InputFolder = @"D:\photo-frame\input";
@abfo
abfo / Perceptron.ipynb
Last active February 15, 2025 19:30
Python perceptron implementation, and sklearn example. From https://ithoughthecamewithyou.com/post/simple-perceptron
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abfo
abfo / todoist-ai.gs
Last active February 17, 2025 01:07
AI assistant for Todoist using OpenAI and Google Apps Script. Instructions at https://ithoughthecamewithyou.com/post/adding-ai-to-todoist-with-google-apps-script-and-openai
// config - ok to leave PERPLEXITY_API_TOKEN blank
const OPENAI_API_TOKEN = '';
const PERPLEXITY_API_TOKEN = ''
const TODOIST_API_TOKEN = '';
const AI_TASK_LABEL = 'ai';
const AI_MESSAGE_PREFIX = 'AI:';
const MAX_GENERATION_ATTEMPTS = 10;
const OPENAI_MODEL = 'gpt-4o'
const PERPLEXITY_MODEL = 'sonar-pro'
@abfo
abfo / rivian.bat
Last active December 16, 2024 00:58
Command line to correct Rivian drive cam footage with ffmpeg. See https://ithoughthecamewithyou.com/post/fix-rivian-drive-cam-distortion for details.
ffmpeg -i input.mp4 -vf "lenscorrection=0.5:0.5:-0.45:0.11" output.mp4
@abfo
abfo / bestplan.ipynb
Last active September 22, 2024 21:29
Python to simulate different PG&E rate plans with an electric vehicle. Why? See https://ithoughthecamewithyou.com/post/which-pge-rate-plan-works-best-for-ev-charging
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abfo
abfo / CORSRule.xml
Created August 11, 2024 23:03
How to enable compression in CloudFront for S3 hosted content. Details at https://ithoughthecamewithyou.com/post/enable-gzip-compression-for-amazon-s3-hosted-website-in-cloudfront
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
<AllowedHeader>Content-Length</AllowedHeader>
</CORSRule>
</CORSConfiguration>
@abfo
abfo / great-highway.ipynb
Last active July 21, 2024 00:20
Analysis of traffic accidents and the closure of the Great Highway in San Francisco. See https://ithoughthecamewithyou.com/post/does-closing-the-great-highway-cause-an-increase-in-traffic-accidents for details.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abfo
abfo / aura-carver-mat-shelf.scad
Last active December 27, 2023 01:13
OpenSCAD code for a wall mount for the Aura Carver Mat digital photo frame. Details at https://ithoughthecamewithyou.com/post/3d-printing-a-discreet-wall-mount-shelf-for-the-aura-carver-mat
difference() {
union() {
cube(size=[61,85,5], center = true);
translate([29.5, 0 ,5]) {
cube(size=[2, 85, 10], center = true);
}
translate([-29.5, 0 ,15]) {
cube(size=[2, 85, 30], center = true);
}
}