Skip to content

Instantly share code, notes, and snippets.

Steven Buehler aliveawakened

Block or report user

Report or block aliveawakened

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aliveawakened
aliveawakened / printCalendar.gs
Created Sep 26, 2019
Google Apps Script: Send today's Google Calendar to hp Printer (via Gmail)
View printCalendar.gs
/*
Creates an HTML email to an HP printer with the current day's events from all Google Calendars.
Uses monospace font because proportional spaced fonts don't kern right when HP renders HTML.
The script moves the sent email to Trash so that it doesn't clutter up your outgoing mailbox.
The HP Printer must have an ePrint email address.
Requires the following Script properties before running:
- printerAddress: the email address to your HP printer.
@aliveawakened
aliveawakened / NHC Wallet 5.ps1
Last active Aug 29, 2019
PowerShell: Sends NHC Advisory Image and Advisory text file to Memobird printer using the HTML API. (Requires pandoc for Markdown conversion)
View NHC Wallet 5.ps1
$ak = '<Access Key>'
$memobirdID = '<memobird device ID>'
$userID = '<API user ID>'
$enc = [system.Text.Encoding]::UTF8
$img = [convert]::ToBase64String((Invoke-WebRequest -Uri 'https://www.nhc.noaa.gov/storm_graphics/AT05/refresh/AL052019_5day_cone_no_line_and_wind+png/204603_5day_cone_no_line_and_wind.png').content)
$forecast = (pandoc -f gfm https://tgftp.nws.noaa.gov/data/hurricane_products/atlantic/storm_5/advisory.txt)
$html = @"
<html><head><style>@media print { body { width: 384px; font-size: 110% } }</style></head>
<body>
<img src="data:image/png;base64,$($img)" width=384><hr />
@aliveawakened
aliveawakened / texttomemobird.gs
Last active Nov 9, 2019
Posts text supplied in POST request to memobird device, wrapping to 32 characters per line.
View texttomemobird.gs
/*
Set the following Script Properties:
- ak: The access key provided by Intertech (http://api.memobird.cn);
- userID: The user ID provided from the Memobird API (the "setuserbind" endpoint, see API documentation);
- memobirdID: Your memobird Device ID (press the button on the front of your memobrid twice to print out your device
info, which includes the 16-character Device ID).
Set up the script below as a Web App, then POST an request to your script's URL with a JSON payload like the following:
@aliveawakened
aliveawakened / nhctropics.gs
Created Aug 29, 2019
Google Apps Script: Memobird API - Print image and Text of NHC Tropical Weather Outlook
View nhctropics.gs
/*
Add the following Script Properties before running:
- ak: the access key provided by Intertech.
- memobirdID: Your memobird's 16-character Device ID.
- userID: the user ID assigned to you when binding the memobird with the API using the setuserbind endpoint.
This script uses the printpaperFromHtml endpoint of the Memobird API to render and print an HTML page containing the latest
Tropical Weather Forecast image and text report from the National Hurricane Center.
This script incorporates the moment.js package (https://www.momentjs.com) for timestamp formatting and the showdown.js package
You can’t perform that action at this time.