-
Text editor
data:text/html;charset=utf-8;base64,PGh0bWwgY29udGVudGVkaXRhYmxlPjx0aXRsZT5Ob3RlcGFkPC90aXRsZT48Ym9keSBvbmxvYWQ9ImRvY3VtZW50LmJvZHkuZm9jdXMoKSIgc3R5bGU9ImZvbnQtZmFtaWx5OkNvbnNvbGFzLCdDb3VyaWVyIE5ldycsbW9ub3NwYWNlLEFyaWFsLHNhbnMtc2VyaWY7Zm9udC1zaXplOjE2cHg7bGluZS1oZWlnaHQ6MS41O3BhZGRpbmc6MjBweDtiYWNrZ3JvdW5kLWNvbG9yOnJnYig0MCw0Miw1NCk7Y29sb3I6cmdiKDI0OCwyNDgsMjQyKSIgc3BlbGxjaGVjaz0idHJ1ZSI+PC9ib2R5PjwvaHRtbD4=
or
data:text/html;charset=utf-8,<html contenteditable><title>Notepad</title><body onload="document.body.focus()" style="font-family:Consolas,'Courier New',monospace,Arial,sans-serif;font-size:16px;line-height:1.5;padding:20px;background-color:rgb(40,42,54);color:rgb(248,248,242)" spellcheck="true"></body></html>
-
Code editor
, You can customize the language field in the following list
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
.content { | |
--gap: clamp(1rem, 6vw, 3rem); | |
--full: minmax(var(--gap), 1fr); | |
--content: min(75ch, 100% - var(--gap) * 2); | |
--popout: minmax(0, 2rem); | |
--feature: minmax(0, 5rem); | |
display: grid; | |
grid-template-columns: | |
[full-start] var(--full) |
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
/* old way */ | |
img { | |
display: block; | |
max-width: 100%; | |
} | |
/* new way */ | |
img { | |
max-width: 100%; | |
height: auto; |
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
class SymmetricEncryptor { | |
#key | |
/** | |
* Create a new SymmetricEncryptor instance. | |
* @param {string} key - The base64-encoded encryption key. | |
*/ | |
constructor(key) { | |
/** | |
* The encryption key. | |
* @type {Uint8Array} |
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
const { createCipheriv, createDecipheriv, randomBytes } = require('crypto') | |
/** | |
* A class for symmetric encryption and decryption using AES-GCM. | |
*/ | |
class SymmetricEncryptor { | |
#key | |
/** | |
* Create a new SymmetricEncryptor instance. | |
* @param {string} key - The base64-encoded encryption key. |
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
/* default DOM */ | |
/* <div class="hide">...</div> */ | |
/* show */ | |
/* el.classList.replace('hide', 'show'); */ | |
/* hide */ | |
/* el.classList.replace('show', 'hide'); */ | |
.show { |
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
{ | |
"version": 2, | |
"builds": [ | |
{ | |
"src": "./index.js", | |
"use": "@vercel/node" | |
} | |
], | |
"routes": [ | |
{ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style> | |
html, | |
body { | |
margin: 0; | |
padding: 0; |
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 React from "react"; | |
type AsProp<C extends React.ElementType> = { | |
as?: C; | |
}; | |
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P); | |
/****************************************** | |
** Not Support Refs version type utility ** |
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 randomNumberBetween(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min) | |
} | |
/** | |
* example: sleep(1000).then(() => { ...doSomeThing }) | |
*/ | |
function sleep(duration) { | |
return new Promise(resolve => { | |
setTimeout(resolve, duration) |
NewerOlder