Skip to content

Instantly share code, notes, and snippets.

Avatar
☁️
Catfood Earth 4 released with all images remastered to 4K

Robert Ellison abfo

☁️
Catfood Earth 4 released with all images remastered to 4K
View GitHub Profile
View GmailSmtp.cs
// 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";
View WIAExtender.cs
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");
View Properties.cs
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;
}
View GoogleFit.gs
// 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')
View NewReferers.gs
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');
View Program.cs
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;
View MobileFriendly.gs
var urlToMonitor = '';
var alertEmail = '';
var runTestKey = '';
var runTestUrl = 'https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run?key=';
function mobileFriendlyMonitor() {
try {
var postBody = {
View PageSpeed.gs
var pageSpeedApiKey = '';
var pageSpeedMonitorUrl = '';
function monitor() {
var desktop = callPageSpeed('desktop', pageSpeedMonitorUrl);
var mobile = callPageSpeed('mobile', pageSpeedMonitorUrl);
var desktopVitals = getVitals(desktop);
var mobileVitals = getVitals(mobile);
View DownloadFrame.gs
function downloadFrame() {
var timestamp = Date.now().toString();
var url = 'https://nexusapi.dropcam.com/get_image?uuid=12345&height=1280&cb=' + timestamp;
var response = UrlFetchApp.fetch(url);
var blob = response.getBlob();
blob.setName(timestamp + '.jpg');
var folders = DriveApp.getFoldersByName('DCFrames');
while (folders.hasNext()) {