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
#include <Wire.h>
#include <ArduCAM.h>
#include <SPI.h>
#include <SD.h>
#include <avr/power.h>
#include <avr/sleep.h>
#include "memorysaver.h"
//#define USE_SERIAL
@abfo
abfo / Code.gs
Last active December 7, 2022 05:22
Apps Script using the Todoist API to set a due date of today on any tasks in the Alexa To-do List and Inbox projects that do not have a due date. For instructions on setting this up see https://ithoughthecamewithyou.com/post/using-the-todoist-api-to-set-a-due-date-on-the-alexa-integration-todo-list-with-apps-script
var ApiToken = '';
function checkForAlexaTasksWithNoDate() {
processProject('Alexa To-do List');
processProject('Inbox');
}
function processProject(projectName) {
var id = getAlexaToDoListId(projectName);
var tasks = getAlexaToDoListTasks(id);
@abfo
abfo / Code.gs
Last active April 25, 2022 08:35
How to monitor page index status using the Google Search Console API and Apps Script in a Google Sheet. For instructions on how to configure this script please see https://ithoughthecamewithyou.com/post/monitor-page-index-status-with-google-sheets-apps-script-and-the-google-search-console-api
var AlertEmail = '';
var SitemapUrl = '';
var SearchConsoleProperty = '';
var WriteRetryCount = 3;
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Search Console')
.addItem('Update Data', 'runUpdate')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abfo
abfo / clouds.cs
Created July 31, 2020 00:15
Code snippet showing how to create an equirectangular cloud image from University of Wisconsin-Madison Space Science and Engineering Center web mercator tiles, see https://ithoughthecamewithyou.com/post/improving-the-accuracy-of-the-new-catfood-earth-clouds-layer for more information
string cloudsDownloadPath = HostingEnvironment.MapPath(CloudsDownloadName);
string cloudsTransformedPath = HostingEnvironment.MapPath(CloudsTransformedName);
string cloudsWarpedPath = HostingEnvironment.MapPath(CloudsWarpedName);
string cloudsFinalPath = HostingEnvironment.MapPath(AxdCloudsHandler.CloudsPath);
string gdalFolder = HostingEnvironment.MapPath(GdalFolder);
string gdalTranslatePath = HostingEnvironment.MapPath(GdalTranslate);
string gdalWarpPath = HostingEnvironment.MapPath(GdalWarp);
// download the most recent tiles
using (Bitmap cloudImage = new Bitmap(CloudsTileDimension * CloudsTileCount, CloudsTileDimension * CloudsTileCount, PixelFormat.Format32bppArgb))
Thread.Sleep(10000); // look like you're doing something
Console.WriteLine("No! Use Google Docs instead."); // reject proposal
@abfo
abfo / Code.gs
Last active April 10, 2020 01:19
Pull Azure Metrics into a Google Sheet (for i.e. Data Studio monitoring). For instructions see https://ithoughthecamewithyou.com/post/using-the-azure-monitor-rest-api-from-google-apps-script
// script settings
var ClientID = '';
var TennantID = '';
var ClientSecret = '';
var ResourceID = '';
var AuthBaseUrl = 'https://login.microsoftonline.com/' + TennantID + '/oauth2/v2.0/authorize';
var AuthTokenUrl = 'https://login.microsoftonline.com/' + TennantID + '/oauth2/v2.0/token';
var AuthScope = 'https://management.azure.com/user_impersonation offline_access';
// script settings
//
// https://ithoughthecamewithyou.com/post/how-to-backup-google-photos-to-google-drive-automatically-after-july-2019-with-apps-script
//
var ClientID = '';
var ClientSecret = '';
var BackupFolder = 'Google Photos';
function onOpen() {
var ui = SpreadsheetApp.getUi();
@abfo
abfo / Code.gs
Last active January 7, 2020 08:59
Apps script to add photos from Google Photos to Google Drive automatically, see https://ithoughthecamewithyou.com/post/how-to-backup-google-photos-to-google-drive-automatically-after-july-2019-with-apps-script for instructions.
// script settings
var ClientID = '';
var ClientSecret = '';
var BackupFolder = 'Google Photos';
var MaxLength = 50000000;
var AlertEmail = ''
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Google Photos Backup')
difference() {
metric_thread(72, 0.75 ,10);
metric_thread(58, 0.75 ,10, internal=true);
}