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 / 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
@abfo
abfo / nest-window-mount.scad
Created April 19, 2023 01:31
OpenSCAD script for a Google Nest Cam Indoor Wired Gen 2 window mount.
difference() {
cube(size=[90, 120, 50]);
translate([45, 50, 0]) {
rotate(a=-25, v=[1,0,0]) {
translate([0, 0, -40]) {
cylinder(h=120, d=66);
}
}
}
}
@abfo
abfo / Code.gs
Created February 13, 2023 01:16
Google Apps Script code to send you an email every time a Google Analytics 4 property has a new referrer. Full instructions at https://ithoughthecamewithyou.com/post/email-alerts-for-new-referers-in-google-analytics-using-apps-script
var PropertyId = '';
var PropertyName = ''
var SendEmailTo = '';
function main() {
var scriptProperties = PropertiesService.getScriptProperties();
var currentProps = scriptProperties.getProperties();
var anythingNew = false;
var newText = '';
@abfo
abfo / Program.cs
Last active February 8, 2023 01:39
Sample code to read an Esri shapefile in .NET using Catfood.Shapefile. For full details please see https://ithoughthecamewithyou.com/post/esri-shapefile-reader-in-net
using Catfood.Shapefile;
using (Shapefile shapefile = new Shapefile(@"fips10c.shp"))
{
Console.WriteLine($"Shapefile type {shapefile.Type}, contains {shapefile.Count:n0} shapes.");
Console.WriteLine($"Bounding box is {shapefile.BoundingBox.Top:n2}, {shapefile.BoundingBox.Left:n2} - {shapefile.BoundingBox.Bottom:n2}, {shapefile.BoundingBox.Right:n2}");
foreach(Shape shape in shapefile)
{
string[] metadataNames = shape.GetMetadataNames();
@abfo
abfo / gtag-parameters.js
Last active November 13, 2022 21:17
Send Google Analytics event parameters with every event to more than one tag - see https://ithoughthecamewithyou.com/post/send-event-parameters-with-every-event-and-multiple-tags-in-google-analytics-4
// from https://developers.google.com/analytics/devguides/collection/ga4/event-parameters?client_type=gtag
gtag('set', {
'page_title': 'Travel Destinations',
'currency': 'USD'
});
// Place your config commands after the set command like follows
gtag('config', 'G-XXXXXXXXXX-1');
gtag('config', 'G-XXXXXXXXXX-2');
gtag('config', 'G-XXXXXXXXXX-3');
https://analytics.google.com/g/collect?v=2&tid=G-555111111&gtm=00000&_p=000000000&_dbg=1&cid=1111111111.2222222222&ul=en-us&sr=1920x1080&uaa=x86&uab=64&uafvl=Google%2520Chrome&uamb=0&uam=&uap=Windows&uapv=15.0.0&uaw=0&_s=4&sid=5551115555&sct=596&seg=1&dl=https...&dt=...&en=recaptcha&_ee=1&epn.rc_score=0.9&epn.rc_count=1&up.user_quality=low
@abfo
abfo / gtag_user_properties.js
Last active November 12, 2022 20:42
User properties example for gtag.js (user scoped custom dimensions in GA4), see https://ithoughthecamewithyou.com/post/user-scoped-custom-dimensions-in-google-analytics-4-using-gtag
gtag('set', 'user_properties', { 'user_quality': 'low' });
@abfo
abfo / Code.gs
Last active August 27, 2022 00:56
LIFX light bulb control from Google Apps Script, sunrise, sunset and holiday colors. Full instructions at https://ithoughthecamewithyou.com/post/control-lifx-wifi-light-bulbs-from-google-apps-script
var LifxToken = '';
var LifxSelector = '';
var Latitude = 37.7749;
var Longitude = -122.4194;
var OnHour = 6;
var OffHour = 23;
var DaytimeOffsetMins = 25;
var DefaultOnColor = 'kelvin:2700';
var DefaultBrightness = 0.75;
var DefaultFadeSeconds = 10.0;