This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Dependencies | |
on: | |
schedule: | |
# https://crontab.guru/#0_0_*_*_WED,SAT | |
# Run every Wednesday and Saturday at 00:00 | |
# 0 0 * * WED,SAT | |
- cron: '0 0 * * WED,SAT' | |
jobs: | |
dependabot: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextApiRequest as DefaultNextApiRequest, NextApiResponse } from "next"; | |
/** | |
* // Route /pages/api/posts/[id] | |
* | |
* const api = defineApi<{ id: string }>() | |
* .get<{ query: { foo: "1" } }, "foo" | "bar">( | |
* async function handler(req, res) { | |
* const session = await getSession({ req }); | |
* if (!session) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
/* | |
Usage | |
import { Style } from "style"; | |
function Heading({children}) { | |
return ( | |
<> | |
<Style>{`h1 { color: red }`}</Style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on 1:connect: { | |
if (%Lagchk == on) { .timerLAG 0 %Lag.secs lagcheck } | |
} | |
alias lagcheck { .ctcpreply $me LAGGC $ticks } | |
on *:CTCPREPLY:LAGGC*: { if ($nick == $me) { set %lag $round($calc((($ticks - $2) / 2) / 1000),2) | echo -a $timestamp lag: %lag $+ secs.. | halt } } | |
alias lag { | |
if ($1 == on) { /set %lagchk on | echo -a Lag Meter: on. | goto { end } } | |
if ($1 == off) { /set %lagchk off | echo -a Lag Meter: off. | goto { end } } | |
if ($1 == delay) { set %Lag.secs $2 | echo -a Lag Meter: checking every: $2 $+ secs. | goto { end } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Hydrator(props) { | |
const [isPaused, setIsPaused] = React.useState(typeof window !== "undefined"); | |
React.useEffect(() => { | |
console.log("Loading polyfills..."); | |
setTimeout(() => { | |
console.log("Done."); | |
setIsPaused(false); | |
}, 3000); | |
}, []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function dom2canvas(element) { | |
await import('https://cburgmer.github.io/rasterizeHTML.js/rasterizeHTML.allinone.js') | |
const canvas = document.createElement('canvas') | |
canvas.width = element.scrollWidth | |
canvas.height = element.scrollHeight | |
await rasterizeHTML.drawHTML(element.outerHTML, canvas) | |
return canvas | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="icon" href="data:image/svg+xml,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle style='fill: red' cx='10' cy='10' r='10'/%3E%3Ctext x='10' y='14' text-anchor='middle' style='fill: white; font-family: sans-serif; font-size: 0.7em;'%3E1%3C/text%3E%3C/svg%3E" type="image/svg+xml" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let currentTheme = 'light' | |
const broadcastThemeChangeFunctions = new Set() | |
let media = null | |
function listener(media) { | |
currentTheme = themes[media.matches ? 'dark' : 'light'] | |
for (let setTheme of broadcastThemeChangeFunctions) { | |
setTheme(currentTheme) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RN's fetch seems to not handling responses with other charsets correctly like Node.js does | |
// eg. the following link returns content-type: "text/html; charset=ISO-8859-1" | |
// https://www.corriere.it/cronache/20_marzo_13/coronavirus-ultimi-aggiornamenti-dall-italia-mondo-d4c07168-64f4-11ea-ac89-181bb7c2e00e.shtml | |
// response.text() resolves to undefined | |
const src = await fetch(url) | |
.then(response => { | |
const charset = (response.headers.get("content-type") || "").split( | |
"charset=" | |
)[1]; | |
if (!charset || charset.toLowerCase() === "utf-8") { |