commit a52039dcddf80ad2500c7c94641da3a3a3854006
parent 4a950f36cab6127c1a64aa24aa8089a0664e3ff1
Author: breadcat <breadcat@users.noreply.github.com>
Date: Tue, 16 Sep 2025 16:41:53 +0100
Latest stack of block posts
Diffstat:
2 files changed, 99 insertions(+), 0 deletions(-)
diff --git a/content/posts/decimal-overtime-calculator.md b/content/posts/decimal-overtime-calculator.md
@@ -0,0 +1,59 @@
+---
+title: "Decimal overtime calculator"
+date: 2025-09-05T15:48:00
+tags: ["Tools", "Work"]
+---
+
+My workplace has a quirky rule when it comes to submitting overtime, everything needs to be calculated in decimal hours. While this isn't especially taxing as far as mathmatical problems go I have [built a bash script](https://github.com/breadcat/nix-configs/blob/main/scripts/overtid.nix) to do this, however I'd prefer not to SSH into a server to run a bit of maths, or grab a calculator so here's the same thing in simple JavaScript:
+
+ <label>Start Time: <input type="time" id="startTime" value="07:30"></label>
+
+ <label>End Time: <input type="time" id="endTime" value="19:30"></label>
+
+ <details><summary>Custom cutoffs</summary>
+ <label>Morning: <input type="time" id="morningCutoff" value="08:30"></label>
+ <br>
+ <label>Evening: <input type="time" id="eveningCutoff" value="18:00"></label>
+ </details>
+
+ <div class="result" id="result"></div>
+
+ <script>
+ function timeToDecimal(timeStr) {
+ const [h, m] = timeStr.split(":").map(Number);
+ return h + m / 60;
+ }
+
+ function calculate() {
+ const start = timeToDecimal(document.getElementById("startTime").value);
+ const end = timeToDecimal(document.getElementById("endTime").value);
+ const morningCut = timeToDecimal(document.getElementById("morningCutoff").value);
+ const eveningCut = timeToDecimal(document.getElementById("eveningCutoff").value);
+
+ let before = 0, after = 0;
+
+ if (start < morningCut) {
+ before = Math.max(0, Math.min(end, morningCut) - start);
+ }
+
+ if (end > eveningCut) {
+ after = Math.max(0, end - Math.max(start, eveningCut));
+ }
+
+ const total = before + after;
+
+ document.getElementById("result").innerHTML = `
+ <br>
+ Hours before: ${before.toFixed(2)}. Hours after: ${after.toFixed(2)}<br>
+ Total hours: ${total.toFixed(2)}
+ `;
+ }
+
+ // live update
+ document.querySelectorAll("input").forEach(input => {
+ input.addEventListener("input", calculate);
+ });
+
+ // Run at start
+ calculate();
+ </script>
diff --git a/content/posts/gamma-horizon-provisioning-strings.md b/content/posts/gamma-horizon-provisioning-strings.md
@@ -0,0 +1,39 @@
+---
+title: "Gamma Horizon Provisioning Strings"
+date: 2025-09-09T16:54:00
+tags: ["Snippets", "Work"]
+---
+
+It's almost like all I do is work these days! Anyway, here's all the provisioning strings I've collected for Gamma Horizon devices over the years. You shouldn't really ever need these but if you do you'll be glad you have them.
+
+```
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_122/122.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_192/192.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_232/232.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_501d/501.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_502d/502.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_504d/504.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_509d/509.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_525d/525.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_6851/6851.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_7832/7832.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_8841/8841.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_8851/8851.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Cisco_8861/8861.xml
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_Trio8500
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_Trio8800
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX150
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX250
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX310
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX410
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX411
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX450
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX500
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX600
+http://xsp.unlimitedhorizon.co.uk/dms/Polycom_VVX601
+http://xsp.unlimitedhorizon.co.uk/dms/Yealink_T46U
+http://xsp.unlimitedhorizon.co.uk/dms/Yealink_W52P
+http://xsp.unlimitedhorizon.co.uk/dms/Yealink_W73P
+```
+
+If you're after passwords once provisioned, try either `DL4DB4JS` or `DB4JO4IM`.
+\ No newline at end of file