docker logs container
docker logs --tail 100 container
docker logs -f container
// Early Hints | |
app.Use(func(c *fiber.Ctx) error { | |
if c.Method() != fiber.MethodGet || | |
!strings.Contains(c.Get("Accept", ""), "text/html") { | |
return c.Next() | |
} | |
for _, entry := range Manifest { | |
switch ext := strings.ToLower(filepath.Ext(entry.File)); ext { | |
case ".js": | |
c.Append("Link", fmt.Sprintf("</%s>; rel=preload; as=script", entry.File)) |
/** | |
* Formatting options for prettyNumber. | |
* Extends all standard Intl.NumberFormatOptions and adds an optional locale override. | |
*/ | |
export interface PrettyNumberOptions extends Intl.NumberFormatOptions { | |
/** BCP 47 language tag, e.g. 'en-US', 'ru-RU'. Defaults to 'en-US'. */ | |
locale?: string; | |
} | |
/** Cache key → Intl.NumberFormat instance */ |
#!/usr/bin/env python3 | |
import re | |
import csv | |
import unicodedata2 | |
import urllib.request | |
EMOJI_TEST_URL = 'https://unicode.org/Public/emoji/latest/emoji-test.txt' | |
MIN_CHAR = 0x20 | |
MAX_CHAR = 0x100000 | |
OUTPUT_CSV = 'unicode.csv' |
@utility scrollbar-hide { | |
-ms-overflow-style: none; | |
scrollbar-width: none; | |
&::-webkit-scrollbar { | |
display: none; | |
} | |
} |
/** | |
* Convert various source URLs (GitHub, npm, unpkg, WordPress) to jsDelivr CDN URLs. | |
* @param sourceUrl — the original file URL | |
* @returns jsDelivr URL or null if the format is not recognized | |
*/ | |
export function toJsDelivr(sourceUrl: string): string | null { | |
const url = new URL(sourceUrl); | |
const { hostname, pathname, searchParams } = url; | |
// GitHub: handle both github.com/blob/... and raw.githubusercontent.com |
import { useEffect } from "preact/hooks"; | |
// Custom hook that calls handler when a click is detected outside of the given ref element | |
const useOnClickOutside = ( | |
ref: { current: HTMLElement | null }, | |
handler: (event: MouseEvent | TouchEvent) => void | |
) => { | |
useEffect(() => { | |
// Listener that calls handler if click is outside of ref element | |
const listener = (event: MouseEvent | TouchEvent) => { |
// This code patches addEventListener globally to force passive wheel events | |
if (typeof window !== 'undefined') { | |
const originalAddEventListener = window.EventTarget.prototype.addEventListener; | |
window.EventTarget.prototype.addEventListener = function(type, listener, options) { | |
if (type === 'wheel') { | |
// Transform options to object and force passive: true | |
if (options === undefined) { | |
options = { passive: true }; | |
} else if (typeof options === 'boolean') { |
const containerRef = useRef<HTMLDivElement | null>(null); | |
useEffect(() => { | |
if (!containerRef.current) return; | |
const observer = new MutationObserver((records) => { | |
const record = records.filter((record) => { | |
const el = record.target as HTMLDivElement; | |
return el.id === 'headlessui-portal-root'; | |
}).pop(); |
#!/usr/bin/python | |
import unicodedata | |
import math | |
import csv | |
MIN_CHAR = 0x20 | |
MAX_CHAR = 0x100000 | |
PROGRESS = 0x8000 |