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
var pageSpeedApiKey = '';
var pageSpeedMonitorUrl = '';
function monitor() {
var desktop = callPageSpeed('desktop', pageSpeedMonitorUrl);
var mobile = callPageSpeed('mobile', pageSpeedMonitorUrl);
var desktopVitals = getVitals(desktop);
var mobileVitals = getVitals(mobile);
var urlToMonitor = '';
var alertEmail = '';
var runTestKey = '';
var runTestUrl = 'https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run?key=';
function mobileFriendlyMonitor() {
try {
var postBody = {
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.Graph;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Newtonsoft.Json.Linq;
var TableId = 'ga:your-view-id';
var SendEmailTo = 'your-email-address';
function main() {
var scriptProperties = PropertiesService.getScriptProperties();
var currentProps = scriptProperties.getProperties();
var anythingNew = false;
var newText = '';
var yesterday = Utilities.formatDate(new Date(new Date().getTime() - 24 * 60 * 60 * 1000), Session.getTimeZone(), 'yyyy-MM-dd');
// add your Google API Project OAuth client ID and client secret here
var ClientID = '';
var ClientSecret = '';
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Google Fit')
.addItem('Authorize if needed (does nothing if already authorized)', 'showSidebar')
.addItem('Get Steps for Yesterday', 'getSteps')
.addItem('Get Steps for past 30 days', 'getHistory')
private void SetDeviceIntProperty(ref Device device, int propertyID, int propertyValue)
{
foreach (Property p in device.Properties)
{
if (p.PropertyID == propertyID)
{
object value = propertyValue;
p.set_Value(ref value);
break;
}
using System.Runtime.InteropServices;
using WIA;
using System.Drawing.Imaging;
namespace WIA2test
{
public static class WIAExtender
{
public static string TiffFormat = ImageFormat.Tiff.Guid.ToString("B");
// Gmail Address from where you send the mail
var fromAddress = "[email protected]";
// any address where the email will be sending
var toAddress = YourEmail.Text.ToString();
//Password of your gmail address
const string fromPassword = "pass";
// Passing the values and make a email formate to display
string subject = YourSubject.Text.ToString();
string body = "From: " + YourName.Text + "\n";
body += "Email: " + YourEmail.Text + "\n";
// add your Google API Project OAuth client ID and client secret here
var ClientID = '';
var ClientSecret = '';
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Google Fit')
.addItem('Authorize if needed (does nothing if already authorized)', 'showSidebar')
.addItem('Get Weight for Yesterday', 'getWeight')
.addToUi();
// add your Google API Project OAuth client ID and client secret here
var ClientID = '';
var ClientSecret = '';
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Google Fit')
.addItem('Authorize if needed (does nothing if already authorized)', 'showSidebar')
.addItem('Get Distance for Yesterday', 'getDistance')
.addToUi();