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 / Code.gs
Created January 22, 2019 00:27
Google fit to google sheets improved sample, handles steps, weight and distance for one or more days at a time. See https://ithoughthecamewithyou.com/post/export-google-fit-daily-steps-to-a-google-sheet for instructions.
// 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 Metrics for Yesterday', 'getMetrics')
.addItem('Get Metrics for past 60 days', 'getHistory')
// 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();
// 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();
// Gmail Address from where you send the mail
var fromAddress = "username@gmail.com";
// 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";
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");
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;
}
// 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')
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');
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 urlToMonitor = '';
var alertEmail = '';
var runTestKey = '';
var runTestUrl = 'https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run?key=';
function mobileFriendlyMonitor() {
try {
var postBody = {