Skip to content

Instantly share code, notes, and snippets.

View lil5's full-sized avatar

Lucian I. Last lil5

View GitHub Profile
@m33x
m33x / hass.js
Last active November 28, 2025 03:52
Simple Home Assistant (HASS) iOS Widget via Scriptable App
let widget = await createWidget();
if (!config.runsInWidget) {
await widget.presentSmall();
}
Script.setWidget(widget);
Script.complete();
async function createWidget(items) {
@lil5
lil5 / lazy_with_preload.ts
Created October 23, 2024 13:38
Lazy with Preload
/* eslint-disable @typescript-eslint/no-explicit-any */
import { ComponentType, lazy } from "react";
/**
* Returns both the component render function and a prefetch function
*
* Example:
*
* ```ts
* import { lazyWithPreload } from "~/utils/lazy_with_preload";