Skip to content

Instantly share code, notes, and snippets.

@1CM69
1CM69 / ephem_solstice.py
Created October 29, 2023 13:10
Just a small piece of Python using the ephem module to find the dates of the summer & winter solstices for the current year, formatting them to a readable format and also calculating the day lengths for each of these.
import time
import datetime
import ephem
LAT = '' # in form 'xx.xxxxxx' or "xx:xx:xx.xx"
LON = '' # in form 'xx.xxxxxx' or "xx:xx:xx.xx"
ELE = 0 # in whole meters
Today = datetime.date.today()
CurrentYear = Today.strftime("%Y")
@1CM69
1CM69 / GetCurrentCalorificValue.ps1
Last active October 29, 2023 07:12
Get the Current Gas Calorific Value for any LDZ in the UK, based on: https://gist.github.com/lwsrbrts/d96092b65f2f7b7952e2f7983a9ee527
cls
$TodayDate = Get-Date -Format "yyyy-MM-dd"
#$TodayDate = "2023-08-15" #for testing
$LDZ = Read-Host -Prompt 'Enter the Local Distribution Zone (LDZ) that you require info for, see here: [https://www.xoserve.com/xoserve-search?term=Postcode%20Exit%20Zone/LDZ%20mapping%20list] '
$Soap = @"
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
@1CM69
1CM69 / GetCalorificAverage.ps1
Last active October 29, 2023 07:13 — forked from lwsrbrts/GetCalorificAverage.ps1
Find the Average Gas Calorific Value for any LDZ in the UK for a period that you specify, based on : https://gist.github.com/lwsrbrts/d96092b65f2f7b7952e2f7983a9ee527
cls
$TodayDate = Get-Date -Format "yyyy-MM-dd"
$TodayDateF = Get-Date -Format "dd/MM/yyyy"
$LDZ = Read-Host -Prompt 'Enter the Local Distribution Zone (LDZ) that you require info for, see here: [https://www.xoserve.com/xoserve-search?term=Postcode%20Exit%20Zone/LDZ%20mapping%20list] '
$PreviousReading = Read-Host -Prompt 'Enter the date of the previous reading in dd/mm/yyyy format'
$PreviousReadingDate = Get-Date $PreviousReading -Format "yyyy-MM-dd"
$Tab = [char]9
$Soap = @"