| Type | Old enhance | Today's enhance | Proposal |
|---|---|---|---|
| Simple result - script |
This file contains hidden or 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() { | |
| const Authorization = ''; // past here AuthKey | |
| const GET = { headers: { Authorization }, method: 'GET' }; | |
| const DELETE = { headers: { Authorization }, method: 'DELETE'}; | |
| const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
| const me = await fetch('/api/v6/users/@me', GET) | |
| .then(r => r.json()) |
This file contains hidden or 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 partial alphanumeric_keys | |
| xkb_symbols "basic" { | |
| // This layout conforms to a new Slovak compromise standard | |
| // designed to satisfy most Unix, Windows and Mac users. | |
| // 2001 by Kamil Toman <ktoman@email.cz> | |
| // 2019 modified by Mlocik97 | |
| // include "latin" | |
| name[Group1] = "Slovak"; |
This file contains hidden or 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
| { | |
| "files.autoSave": "afterDelay", | |
| "editor.wordWrap": "on", | |
| "editor.insertSpaces": false, | |
| "editor.minimap.enabled": false, | |
| "files.hotExit": "off", | |
| "workbench.editor.enablePreview": false, | |
| "workbench.editor.enablePreviewFromQuickOpen": false, | |
| "editor.renderWhitespace": "none", | |
| "vs-kubernetes": { |
This file contains hidden or 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
| <script> | |
| import { shell } from 'electron'; | |
| </script> | |
| <div> | |
| <a href="url" on:click|preventDefault={() => shell.openExternal(this.href)}>link</a> | |
| </div> |
This file contains hidden or 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 { invalidate } from '$app/navigation'; | |
| // this action (https://svelte.dev/tutorial/actions) allows us to | |
| // progressively enhance a <form> that already works without JS | |
| /** | |
| * @param {HTMLFormElement} form | |
| * @param {{ | |
| * pending?: ({ data, form }: { data: FormData; form: HTMLFormElement }) => void; | |
| * error?: ({ | |
| * data, | |
| * form, |
This file contains hidden or 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 overlayNode = document.getElementsByClassName("overlayer").item(0); | |
| const timeout = 20; | |
| const config = { | |
| subtree: true, | |
| characterData: true, | |
| }; | |
| const layerObserver = new MutationObserver(mutated); | |
| function mutated(mutations) { |
This file contains hidden or 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 { build, files, version } from '$service-worker'; | |
| // https://github.com/microsoft/TypeScript/issues/11781 - this is needed for TS and ESLint | |
| /// env serviceworker | |
| const globalThis = /** @type {unknown} */ (self); | |
| /// <reference no-default-lib="true"/> | |
| /// <reference lib="es2020" /> | |
| /// <reference lib="WebWorker" /> | |
| const sw = /** @type {ServiceWorkerGlobalScope & typeof globalThis} */ (globalThis); |
This file contains hidden or 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
| export async function handle({ event, resolve }) { | |
| const cookies = await cookie.parse(event.request.headers.get('cookie') || ''); | |
| if (event.url.pathname == '/login') { | |
| // skip verifying user, and allow to load website | |
| const response = await resolve(event); | |
| return response; | |
| } | |
| const user = DB.User.findOne({session: cookies.token}); |
OlderNewer