Skip to content

Instantly share code, notes, and snippets.

View xtellurian's full-sized avatar
🐐

Rian Finnegan xtellurian

🐐
View GitHub Profile
from PIL import Image
img_path="path_to/image.tiff"
image = Image.open(jpg_path)
# get the current width and height
width, height = image.size
# Setting the points for cropped image
# you can change these values
@xtellurian
xtellurian / Latency.csproj
Created November 23, 2019 07:00
Latency Tester
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>
@xtellurian
xtellurian / wz.json
Created October 15, 2019 03:32
Weatherzone API response
{
"api_version": "1.0",
"metadata": {
"sector": "weather",
"title": "Weatherzone",
"provider_name": "Weatherzone",
"provider_url": "http:\/\/www.weatherzone.com.au",
"project_version": "3.23",
"revision": 30006,
"last_commit": "2019-10-10 08:55:00 +1000 (Thu, 10 Oct 2019)",
@xtellurian
xtellurian / aem-5min.json
Created October 10, 2019 22:48
API Response from AEMO electricity, 5 minute data
{
"5MIN": [
{
"SETTLEMENTDATE": "2019-10-10T08:30:00",
"REGIONID": "NSW1",
"REGION": "NSW1",
"RRP": 102.47000,
"TOTALDEMAND": 7494.60000,
"PERIODTYPE": "ACTUAL",
"NETINTERCHANGE": -5.85000,
@xtellurian
xtellurian / docker-compose.yaml
Created September 24, 2018 00:41
Interactive powershell terminal with your code in there
version: '3'
services:
# docker-compose run ps
ps:
image: mcr.microsoft.com/powershell:ubuntu-xenial
stdin_open: true
tty: true
container_name: ps1
volumes:
- ./:/your_code
@xtellurian
xtellurian / setup_dev_machine.ps1
Last active March 26, 2023 01:12
choco installs
choco install -y git hyper vscode windirstat nvs python azure-cli docker-desktop make docker-kitematic dotnetcore-sdk gitkraken microsoftazurestorageexplorer miniconda3
@xtellurian
xtellurian / setup_iotedge_armv7.sh
Last active November 30, 2021 11:09
Setting up Azure IoT Edge runtime on Linux ARM e.g. Rasperry Pi
set -e
# update OS
sudo apt update && sudo apt full-upgrade -y
# update some bluetooth drivers
sudo apt-get install -y pi-bluetooth bluez bluez-firmware libbluetooth-dev libudev-dev
# Download and install the moby-engine
curl -L https://aka.ms/moby-engine-armhf-latest -o moby_engine.deb && sudo dpkg -i ./moby_engine.deb
@xtellurian
xtellurian / edge.sh
Last active July 8, 2018 07:05
DEPRECATED - This gist helps you setup a raspberry pi for IoT Edge
#!/bin/bash
# Run this last to setup and start IoT Edge Runtime
set -x
set -e
echo "Setting up IoT Edge runtime"
if [ -z $1 ]
then
echo "Usage: ./setup-iotedge.sh <Connection-String>"
exit 1
@xtellurian
xtellurian / EventsController.cs
Created October 27, 2017 00:26
An ASP.NET Api Controller for Azure Event Grid Webhooks
using Newtonsoft.Json.Linq;
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
namespace MyApp.Api.Controllers
{
public class EventsController : ApiController
@xtellurian
xtellurian / DirectLineClient.cs
Last active October 5, 2017 04:12
A C# Bot Framework Direct Line Client, Generated by NSwagStudio
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v11.9.0.0 (NJsonSchema v9.7.1.0 (Newtonsoft.Json v9.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
// https://docs.botframework.com/en-us/restapi/directline3/swagger.json
namespace Microsoft.BotFramework.DirectLine
{