yarn create next-app
run setup.sh
Update package.json
"lint-staged": {
import * as z from "zod"; | |
const camelToSnakeCase = (str: string) => | |
str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); | |
const validActions = ["HELLO_THERE"] as const; | |
const ValidActionsSchema = z.enum(validActions); | |
const ParseableSchema = z.object({ | |
action: z.string().transform((value, ctx) => { |
const customSuperProp = {}; | |
function register(obj) { | |
Object.assign(customSuperProp, obj); | |
} | |
function unregister(key) { | |
delete customSuperProp[key]; | |
} |
const pt = parseFeed(result.feedResponse); | |
/** Compatibility function to align partytime output with existing podverse item format */ | |
const itemCompat = (episode) => { | |
const { | |
author, | |
description, | |
duration, | |
enclosure, | |
explicit, |
const fetch = require("node-fetch") | |
const {parseFeed} = require("podcast-partytime") | |
fetch("https://podnews.net/clock-rss") | |
.then(resp => resp.text()) | |
.then(xml => parseFeed(xml)) | |
.then(console.log) |
// ==UserScript== | |
// @name Republic Times Cleanup | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://republictimes.net/* | |
// @match https://republictimes.net | |
// @match http://republictimes.net/* | |
// @grant none |
/** | |
* Traverse up the dom to find a sticky parent node crossing any shadow boundaries | |
*/ | |
export function findStickyParent(element: HTMLElement): HTMLElement | null { | |
let elm = element.parentNode || element.host; | |
while (elm) { | |
if (elm.style && elm.style.top && window.getComputedStyle(elm).position === `sticky`) { | |
return elm; |
const uuid1 = "da507fb6-5417-495a-b1f3-a23518f6b9ea"; | |
const uuid2 = "b21e5078-8da2-421b-8b26-ace980f4164a"; | |
//#region Uint8Array | |
/* https://stackoverflow.com/questions/38987784/how-to-convert-a-hexadecimal-string-to-uint8array-and-back-in-javascript */ | |
const fromHexString = hexString => | |
new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16))); | |
const toHexString = bytes => | |
bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), ''); |
.next | |
__generated__ |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |