Skip to content

Instantly share code, notes, and snippets.

@grischard
grischard / lim_admin_distance.py
Created April 11, 2025 06:38
Compare OpenStreetMap admin boundaries to official open data
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "click",
# "requests",
# "geopandas",
# "shapely",
# "pyproj",
# "rich",
@grischard
grischard / swatch_beats.js
Last active October 2, 2024 21:56
Swatch beats Home Assistant
class SwatchBeatBase extends HTMLElement {
interval = null;
connectedCallback() {
if (!this.interval) {
this.interval = setInterval(() => this.updateBeats(), 86);
}
}
disconnectedCallback() {
00:00:00.001 HDW: ESP8266EX
00:00:00.036 CFG: Loaded from flash at FB, Count 293
00:00:00.041 SER: Set to 8E1 4800 bit/s
00:00:00.248 QPC: Reset
00:00:00.251 CFG: CR 347/699, Busy 0
00:00:00.255 TYA: Active=0
00:00:00.259 ROT: Mode 1
00:00:00.260 NRG: Init driver 2
00:00:00.261 SRC: Restart
00:00:00.262 Project tasmota - Neon Version 13.4.0(tasmota)-2_7_6(2024-02-14T16:13:56)
19:21:04.104 MQT: Attempting connection...
19:21:04.123 MQT: Connected
19:21:04.127 MQT: tele/tasmota_28AF0B/LWT = Online (retained)
19:21:04.129 MQT: cmnd/tasmota_28AF0B/POWER =
19:21:05.244 MQT: stat/tasmota_28AF0B/RESULT = {"Time":"2024-06-10T19:21:05","Uptime":"0T00:01:24","UptimeSec":84,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":5,"POWER":"OFF","Wifi":{"AP":1,"SSId":"NYCR24","BSSId":"28:3B:82:4C:E3:DE","Channel":6,"Mode":"11n","RSSI":100,"Signal":-50,"LinkCount":1,"Downtime":"0T00:00:05"}}
19:21:05.347 MQT: stat/tasmota_28AF0B/STATUS1 = {"StatusPRM":{"Baudrate":4800,"SerialConfig":"8E1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Software/System restart","Uptime":"0T00:01:24","StartupUTC":"2024-06-10T18:19:41","Sleep":50,"CfgHolder":4617,"BootCount":7,"BCResetTime":"2022-09-27T00:17:48","SaveCount":282,"SaveAddress":"FB000"}}
19:21:14.235 MQT: Attempting connection...
19:21:14.254 MQT: Connected
19:21:14.258 MQT: tele
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
alias: Auto-Relock Elevator Door
description: ""
trigger:
- platform: state
entity_id: input_boolean.auto_lock_elevator_door
to: 'off'
for:
hours: 5
- platform: state
entity_id: switch.elevator_door
import subprocess
import time
import re
import signal
import psutil
# List of garbage collectors to test
garbage_collectors = [
"-XX:+UseG1GC",
"-XX:+UseParallelGC",

Planet on S3 proposal

Goals

  • Move planet.openstreetmap.org to S3
  • Maintain existing URLs to latest files
  • Maximise backwards compatibility
  • Make it possible to get notifications for files by subscribing to a prefix over aws sns
  • Simplify directory structure
    • Paul's goals:
<?xml version="1.0" encoding="UTF-8"?>
<WMS_Capabilities version="1.3.0"
xmlns="http://www.opengis.net/wms"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:esri_wms="http://www.esri.com/wms"
xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.esri.com/wms https://sigmzl.manizales.gov.co/wadmzl/services/Ortofotomapas/2022_ORTOFOTO_RURAL/MapServer/WMSServer?version=1.3.0%26service=WMS%26request=GetSchemaExtension">
<Service>
<Name><![CDATA[WMS]]></Name>
<Title><![CDATA[Ortofotomapas_2022_ORTOFOTO_RURAL]]></Title>