Are there any problems with this code?
export function escapeHtml(text: string): string {
return text
.replace(/</g, "<")
.replace(/&/g, "&")
.replace(/>/g, ">")
.replace(/"/g, """)
bits 16 | |
cpu 8086 | |
org 0100h | |
section .data | |
SInstalled: db "DOSVER is allready installed.",0ah,0dh | |
section .text |
// Modern bir tarayıcıda https://www.turkiye.gov.tr/istanbul-buyuksehir-belediyesi-vefat-sorgulama | |
// adresine gidip bu kodu developer console'a yapıştırarak çalıştırabilirsiniz. | |
(function() { | |
async function send(url, date) { | |
let fd = new FormData(); | |
fd.append("tarih", date); | |
fd.append("token", document.body.dataset.token); | |
fd.append("btn", "Sorgula"); |
(function () { | |
const ticks = Array.from( | |
document.querySelectorAll("[aria-label='Verified account']") | |
) | |
.filter( | |
(tick) => | |
tick?.parentElement?.parentElement?.children[0].textContent === | |
"Elon Musk" | |
) | |
.forEach((tick) => { |
interface RpcModules { | |
"example-remote-module": MapReturnTypesToPromise< | |
typeof import("example-remote-module") | |
>; | |
} | |
export function importRemote<S extends keyof RpcModules>( | |
module: S | |
): RpcModules[S] { | |
return new Proxy({} as any, { |
export function observable<T>(value: T): Observable<T> { | |
const subscribers = new Set<(val: T) => void>(); | |
function run(): T; | |
function run(newValue: T): void; | |
function run(updateFunction: (oldValue: T) => T): void; | |
function run(newValueOrUpdateFn?: T | ((oldValue: T) => T)): T | void { | |
if (newValueOrUpdateFn === undefined) { | |
return value; | |
} |
import { Dispatch, SetStateAction, useState, useEffect } from 'react'; | |
export function usePersistentState<T>( | |
key: string, | |
defaultValue: T | |
): [T, Dispatch<SetStateAction<T>>] { | |
const [state, setState] = useState<T>(defaultValue); | |
// Save to session storage on unload | |
useEffect(() => { |
import { createServer } from "node:http"; | |
import { AsyncLocalStorage } from "node:async_hooks"; | |
const asyncLocalStorage = new AsyncLocalStorage(); | |
createServer((req, res) => { | |
asyncLocalStorage.run({ req, res }, () => { | |
asyncHandler().catch((err) => { | |
console.error(err); | |
if (!res.writableEnded) { |
import fs from "node:fs"; | |
import path from "node:path"; | |
import url from "node:url"; | |
const cache = {}; | |
function createRequire(filename) { | |
function require(specifier) { | |
const resolved = require.resolve(specifier); | |
if (resolved in cache) { |
function fnThatReturnsPromiseOrValue() { | |
const random = Math.random(); | |
if (random > 0.5) { | |
return Promise.resolve(random); | |
} else { | |
return random; | |
} | |
} | |
async function naive() { |