Skip to content

Instantly share code, notes, and snippets.

@sengiv
sengiv / doc.md
Created April 12, 2026 04:37
Full‑Stack PWA Implementation Blueprint for a Static‑Hosted HTML/JavaScript Astrology App

Full‑Stack PWA Implementation Blueprint for a Static‑Hosted HTML/JavaScript Astrology App

Goal, assumptions, and what “full compatibility” realistically means

This document is written as a technical instruction set for an AI coding agent that has access to an existing HTML/JavaScript astrology web app hosted on static hosting (for example, a static storage website). The goal is to convert the site into a production‑grade Progressive Web App (PWA) “with all the bells and whistles” where the platform allows it. citeturn1search24turn1search29turn0search12

Key constraint: “Full compatibility with Android and iOS” does not mean “every native feature on both OSes.” It means:

  • Implement PWA capabilities using standards (manifest, service worker, modern Web APIs). citeturn1search29turn2search0turn5search5turn1search21
  • Use progressive enhancement: enable features when the runtime supports them; provide fallbacks when it doesn’t. citeturn0search13turn1search7
@sengiv
sengiv / random-show-watch.py
Created April 18, 2024 12:43
Randomly selects and plays shows from multiple local file location. Nice for rewatching same series shows, but from random points.
import os
import random
import subprocess
import json
def get_mp4_files(paths, depth=1):
mp4_files = []
for path in paths:
if depth < 0:
return mp4_files
# Get the current PATH
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
# Your MSBuild path
$msbuildPath = "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin"
# Create a new PATH
$newPath = $currentPath + ";" + $msbuildPath
# Set the new PATH
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
@sengiv
sengiv / TextToSvg.js
Created April 6, 2023 00:32
Input text converts to nicely formatted SVG box
//FUNCTION
// This function attempts to create a new svg "text" element, chopping
// it up into "tspan" pieces, if the text is too long
static textToSvg(caption, x, y) {
//svg "text" element to hold smaller text lines
var svgTextHolder = document.createElementNS('http://www.w3.org/2000/svg', 'text');
svgTextHolder.setAttributeNS(null, 'x', x);
svgTextHolder.setAttributeNS(null, 'y', y);
svgTextHolder.setAttributeNS(null, 'font-size', 10);
@sengiv
sengiv / moto-verve-300-reset.txt
Created March 16, 2023 14:20
Reset Motorola Verve 300
reset the earbuds individually, not together,
then return them to the case,
take them out, let them sync together, leaving them 2 or 3 minutes,
once the left earbud has stopped flashing,
then turned on the phone BT and connected to the right earbud
@sengiv
sengiv / findInXml.js
Created March 5, 2023 08:48
Simple JS function to find and retrieve text from xml file
//gets events from EventDataList.xml
//for viewing in time legend
async function getEventDescription(eventName) {
//search for matching event name
var eventXmlList = window.$EventDataListXml.find('Event'); //get all event elements
var results = eventXmlList.filter(
function () {
var eventNameXml = $(this).children('Name').eq(0);
return eventNameXml.text() === eventName;
});
@sengiv
sengiv / R80X50-PQ-CCTV-Config.txt
Created October 21, 2022 00:58
ICsee R80X50-PQ CCTV Camera Config
stream:
camera:
- platform: generic
name: iCsee
still_image_url: "http://<CAMERA_IP_ADDRESS>/webcapture.jpg?user=admin&password=<PASSWORD>&command=snap&channel=1"
stream_source: "rtsp://<CAMERA_IP_ADDRESS>:554/user=admin&password=<PASSWORD>&channel=2&stream=0.sdp?real_stream"
@sengiv
sengiv / SetAppPATHForTerminal.ps1
Created October 14, 2022 16:12
When run will add a directory to cmd/powershell PATH, so for example this code will make azcopy command available in terminal
$InstallPath = 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy'
# Add InstallPath to the System Path if it does not exist
if ($env:PATH -notcontains $InstallPath) {
$path = ($env:PATH -split ";")
if (!($path -contains $InstallPath)) {
$path += $InstallPath
$env:PATH = ($path -join ";")
$env:PATH = $env:PATH -replace ';;', ';'
}
@sengiv
sengiv / Programming Rules Ordered By Priority
Created July 2, 2022 02:15
Programming Rules Ordered By Priority
1.Easy Readablilty
2.No Duplication
3.Performance Gain
Explantion:
When there is decision to be made between a comprimise
of Easy Readablity & No Duplication, make the decision in favor of Readability.
This will lead to code with easier maintainence down the road.
@sengiv
sengiv / Windows Force Hibernate
Created July 2, 2022 02:00
Windows Force Hibernate With Desktop Shortcut
Create shortcut with below target:
rundll32.exe powrprof.dll,SetSuspendState 0,1,0