Summer Solstice 2017
Summer starts now (or Winter for the Southern Hemisphere). Rendered in Catfood Earth.
(Previously, Previously, Previously, Previously)
I needed a console app that reads some inputs from an online Excel workbook, does some processing and then writes back the results to a different worksheet. Because I enjoy pain I decided to use the thinly documented new Microsoft.Graph client library. The sample code below assumes that you have a work or education Office 365 subscription.
Paste the code into a new console project and then follow the instructions at the top to add the necessary NuGet packages. You'll also need to register an application at https://portal.azure.com/. You want a Native application and you'll need the Application ID and the redirect URL (just make up some non-routable URL for this). Under Required Permissions for the app you should add read and write files delegated permissions for the Microsoft Graph API.
Hope this saves you a few hours. Comment below if you need a more detailed explanation for any of the above.
(Published to the Fediverse as: Reading and Writing Office 365 Excel from a Console app using the Microsoft.Graph C# Client API #code #microsoft #excel #graph #office365 How to read and write data to an Office 365 Excel workbook using the Microsoft.Graph client library from a C# console application. )
Summer starts now (or Winter for the Southern Hemisphere). Rendered in Catfood Earth.
(Previously, Previously, Previously, Previously)
Microsoft is finally pulling the plug on CodePlex. I've hosted various projects there over the years and have just finished migrating everything over to GitHub which looks like it just might have a future:
(Published to the Fediverse as: CodePlex Shutdown: Shapefile, Orb, StackHash and Blogger2BlogML Migration #code #stackhash #codeplex #github CodePlex is gone. Shapefile, Orb, StackHash and Blogger2BlogML have been migrated to GitHib. )
Vernal Equinox 2017 happens right now, as rendered in Catfood Earth.
Catfood Weather is a free taskbar based weather forecast app for Windows that includes a seven day forecast and severe weather alerts. It uses National Weather Service data and works for any US location (by ZIP code or latitude and longitude).
This update fixes a problem calling the National Weather Service API, so please install 2.30 if you're using a previous version of Catfood Weather. To get alerts for new releases follow the RSS Feed or sign up to the ITHCWY Newsletter.
Download Catfood Weather 2.30.
(Published to the Fediverse as: Catfood Weather 2.30 #code #weather Free taskbar based weather forecasts for Windows. Hover for current conditions, click for a seven day outlook and you get automatic severe weather alerts. US locations by ZIP or latitude/longitude only. )
Google axed this tool today, so the script won't work any more. If you're looking for a replacement check out my Core Web Vitals script.
Google just released an API for the mobile friendly test and so I've whipped up a script to send an alert if a web page violates their guidelines. This will run the test as often as you like and send you an email if it detects a problem. Alternatively if you're not mobile friendly it will keep emailing you until you fix any problems which might be a good motivational tool.
First start a new apps script project in drive and paste in the code below:
There are three variables you need to set, urlToMonitor is the full URL of the page to test, alertEmail is your email address (or whoever needs to be pestered) and runTestKey is the API key for the service. To get this go to the Google API Console, click Enable API, search for 'Google Search Console URL Testing Tools API' and click enable. Then click the Credentials option and generate a browser key.
Once you've configured the script choose 'Current project's triggers' from the Resources menu in apps script and set up a schedule for the mobileFriendlyMonitor() function.
(Published to the Fediverse as: Get an email if your site stops being mobile friendly (no longer available) #code #mobile #appsscript #gas Use Google Apps Script and the Mobile Friendly Test API to constantly monitor your site for any violations. )
This is the first time I've been late with a solstice or equinox post. On the 21st of December at 10:44 UTC it was the start of Winter for the Northern hemisphere, Summer down south. Rendered in Catfood Earth (back dated to the right date and time... Windows, Android).
(Previously, Previously, Previously)
By default compression doesn't work in CloudFront for a website backed by an Amaxon S3 bucket.
The first step is pretty obvious - switch on compression in CloudFront:
To get to this setting open you distribution, go to the Behaviors tab and edit your behavior(s). Scroll down to the bottom and toggle Compress Objects Automatically to On. Save and drum your fingers while the distribution updates.
The less obvious piece is that CloudFront will only compress files between 1,000 and 10,000,000 bytes (as of writing this post) and it detects the filesize from the Content-Length header. What the documentation doesn't mention is that S3 does not send the Content-Length header by default and so no compression is applied.
Go to S3 and open the properties for your bucket (not for individual files). Expand Permissions and then click Edit CORS Configuration. You need to add Content-Length as an allowed header like this:
(Published to the Fediverse as: Enable GZIP compression for Amazon S3 hosted website in CloudFront #code #software #s3 #cloudfront #aws How to configure Amazon CloudFront to apply gzip compression for websites hosted using Amazon S3 (Simple Storage Service) )
It's Autumn in the Northern Hemisphere, Spring down south. Rendered in Catfood Earth (Windows, Android).
(Previously, Previously, Previously)
It's the start of Summer (or Winter in the Southern Hemisphere). Unusually for June it even feels like Summer in San Francisco today. Rendered in Catfood Earth (Windows, Android).
(Previously, Previously, Previously)
Export Google Fit Daily Steps, Weight and Distance to a Google Sheet
Download a Sharepoint File with GraphServiceClient (Microsoft Graph API)
Which PG&E rate plan works best for EV charging?
Monitor page index status with Google Sheets, Apps Script and the Google Search Console API
Scanning from the ADF using WIA in C#
Vibe Coding a Vibe Video Editor
Long term solar powered time lapse camera using Arduino
Predicting when fog will flow through the Golden Gate using ML.NET
Improving the accuracy of the new Catfood Earth clouds layer