Skip to content

Instantly share code, notes, and snippets.

View yanli0303's full-sized avatar

Yan Li yanli0303

View GitHub Profile
@yanli0303
yanli0303 / dark-mode-invert-color.css
Created January 11, 2025 15:40
dark-mode-invert-color.css
@media (prefers-color-scheme: dark) {
pre.src > *,
pre.example > * {
filter: invert(20%) brightness(200%);
}
}
html:has(meta[name="color-scheme"][content="dark"]) pre.src > *,
html:has(meta[name="color-scheme"][content="dark"]) pre.example > * {
filter: invert(20%) brightness(200%);
@yanli0303
yanli0303 / http-cache-headers.md
Created July 31, 2024 17:32
HTTP cache headers

HTTP cache headers

  • Immutable Files: Cache-Control: max-age=31536000
  • Mutable Files: Cache-Control: no-cache; etag; Last-Modified;
  • Never cache: Cache-Control: no-store;
@yanli0303
yanli0303 / html-popover-property.html
Created July 31, 2024 17:31
HTML popover property
<!DOCTYPE html>
<html>
<head>
<title>HTML popover property</title>
</head>
<body>
<button id="button" popovertarget="select">请选择</button>
<menu id="select" popover>
<div><input type="radio" name="type" value="">请选择</div>
@yanli0303
yanli0303 / xz-compress-decompress-files.md
Created July 31, 2024 17:29
Compress and decompress files with xz

Compress and decompress files with xz

See xz manual

# compress a directory
XZ_OPT='-9' tar -chvJf output-file.tar.xz -C /your/dir .

# The output archive of the above command doesn't contain the root directory.
# To compress a directory with its name in the output archive, use below command:
@yanli0303
yanli0303 / jenkins-with-docker.md
Created July 14, 2023 16:14
Set up Jenkins server with Docker
@yanli0303
yanli0303 / html-script-integrity.sh
Created August 10, 2021 14:11
Shell command for calculating the HTML script tag integrity
cat SCRIPT_FILE | openssl dgst -sha512 -binary | openssl base64 -A