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 / 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);
}
}
@abfo
abfo / kong-holder.scad
Last active June 26, 2023 00:07
SCAD design for a 3D printed Kong XL Holder. See https://ithoughthecamewithyou.com/post/3d-printing-a-kong-xl-holder for details.
difference() {
cube(size=[86,86,70]);
translate([43,43,10]) {
cylinder(h=35, d=60);
translate([0,0,30]){
cylinder(h=35, d=78);
}
}
translate([-2,-2,10]) {
cube(size=[40,40,70]);
// uses Google.Analytics.Data.V1Beta from NuGet
// credentials from Google cloud project authentication export
// GA4 Profile ID from GA4 Admin
var client = new BetaAnalyticsDataClientBuilder
{
CredentialsPath = "PathToCredentials.json"
}.Build();
RunReportRequest request = new RunReportRequest