Skip to content

Instantly share code, notes, and snippets.

@KTibow
KTibow / AddNotification.svelte
Created April 12, 2023 11:45
My system for web notifications
<script>
import { PUBLIC_NOTIF_KEY } from "$env/static/public";
let setupState = false;
async function setup() {
setupState = "loading-0";
await Notification.requestPermission();
const registration = await navigator.serviceWorker.ready;
setupState = "loading-1";
let sub;
try {
@jovimon
jovimon / cdmon_update.py
Last active July 6, 2023 07:37
CDMon dynamic DNS IP update script
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Python script to update CDMon dynamic DNS
#
# @author = @jovimon
# @version = 0.1.20200930
#
# Prerequisites: sudo pip install requests / sudo apt install python-requests
#
@fethica
fethica / Units.swift
Last active June 11, 2025 10:22
[Swift] Convert Bytes to Kilobytes to Megabytes to Gigabytes
public struct Units {
public let bytes: Int64
public var kilobytes: Double {
return Double(bytes) / 1_024
}
public var megabytes: Double {
return kilobytes / 1_024