Skip to content

Instantly share code, notes, and snippets.

View BXYMartin's full-sized avatar
🎯
Focusing

Martin BXYMartin

🎯
Focusing
View GitHub Profile
@BXYMartin
BXYMartin / TfL.js
Created March 15, 2025 14:33
Scriptable widget to monitor Transport for London (TFL) status
const API_URL = "https://api.tfl.gov.uk/line/mode/tube/status";
// Define official TfL colors
const LINE_COLORS = {
"Bakerloo": "#B36305",
"Central": "#E32017",
"Circle": "#FFD300",
"District": "#00782A",
"Hammersmith & City": "#F3A9BB",
"Jubilee": "#A0A5A9",
@BXYMartin
BXYMartin / octopus.js
Last active March 15, 2025 14:36
Scriptable Widget for Octopus Energy Agile Plan Electricity Price
let widget = new ListWidget();
widget.backgroundColor = new Color("#180048");
const header = widget.addText("Octopus Energy");
header.font = Font.boldSystemFont(12);
header.textColor = Color.white();
widget.addSpacer();
function getFormattedDate(date) {
return date.toISOString().split(".")[0] + "Z";