Skip to content

Instantly share code, notes, and snippets.

View abfo's full-sized avatar
☁️
Building Aurora: https://github.com/abfo/aurora

Robert Ellison abfo

☁️
Building Aurora: https://github.com/abfo/aurora
View GitHub Profile
var apiKey = '';
var monitorUrl = '';
var originUrl = '';
function monitor() {
// CRUX
var allCrux = callCrux(null, originUrl);
var desktopCrux = callCrux('DESKTOP', originUrl);
var mobileCrux = callCrux('MOBILE', originUrl);
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 = "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";
// 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();