Skip to content

Instantly share code, notes, and snippets.

View guest271314's full-sized avatar
💭
Fix WontFix

guest271314

💭
Fix WontFix
View GitHub Profile
@korchasa
korchasa / base64.md
Last active March 7, 2025 03:13
test llm search injection

History of infant schools in Great Britain

A teacher sits in front of a number of children, many of whom do not appear very attentive. Which is your Right Hand?, illustration of an unidentified infant class, drawn by Paul Renouard [fr] and published in The Graphic (1898)[note 1] The first infant school in Great Britain was founded in New Lanark, Scotland, in 1816. It was followed by other philanthropic infant schools across Great Britain. Early childhood education was a new concept at the time and seen as a potential solution to social problems related to industrialisation. Numerous writers published works on the subject and developed a theory of infant teaching. This included moral education, physical exercise and an authoritative but friendly teacher.

In England and Wales, infant schools served to maximise the education children could receive before they left school to start work. They were valued by parents as a form of childcare but proved less popular in Scotland. State-funded schools in England and

@jamesjay2924
jamesjay2924 / css-blossoming-flowers-at-magical-night.markdown
Created February 17, 2025 01:57
CSS Blossoming Flowers at Magical Night
@leipreachan
leipreachan / simple.js
Last active February 17, 2025 09:29
different solutions to check for duplicates
const hasDuplicateOneline = (array) =>
new Set(array).size != array.length;
const hasDuplicateAlternative = (arr) =>
arr.some((value, index, origin) => origin.indexOf(value) !== index);
let z = [];
for (let i = 0; i < 10_000; i++) {
z.push(i);
}
@tatsuyax25
tatsuyax25 / constructDistancedSequence.js
Created February 16, 2025 20:03
Given an integer n, find a sequence that satisfies all of the following: The integer 1 occurs once in the sequence. Each integer between 2 and n occurs twice in the sequence. For every integer i between 2 and n, the distance between the two occurren
/**
* @param {number} n
* @return {number[]}
*/
var constructDistancedSequence = function(n) {
// Initialize the sequence array with 0s and an array to track placed numbers
const seq = new Array(n * 2 - 1).fill(0), isPlaced = new Array(n + 1).fill(false);
// Mark index 0 as placed (not used in actual sequence)
isPlaced[0] = true;
@dsherret
dsherret / generate.js
Last active February 17, 2025 04:01
@types packages on npm with dependencies outside the @types scope
// How to generate output:
// > git clone https://github.com/DefinitelyTyped/DefinitelyTyped
// > cd DefinitelyTyped
// > deno run --allow-read <url-to-this-file-goes-here> (click raw in the top right corner for url)
import { Path } from "jsr:@david/[email protected]";
const typesDir = new Path("./types");
const entries = typesDir.readDirSync();
for (const entry of entries) {
if (!entry.isDirectory) {
@mattfysh
mattfysh / index.ts
Last active February 4, 2025 15:14
Bun socket listener invoked twice [intermittent]
import net from 'node:net'
import { spawn } from 'bun'
const ready = Promise.withResolvers<number>()
const server = spawn({
cmd: ['bun', 'server.ts'],
stdio: ['inherit', 'inherit', 'inherit'],
serialization: 'json',
ipc: port => ready.resolve(port),
@bogeychan
bogeychan / adapter.ts
Last active April 3, 2025 21:14
Basic Bun HTTP2 Adapter for ElysiaJS
// based on https://github.com/elysiajs/elysia/blob/main/src/adapter/bun/index.ts
import type { ElysiaAdapter, MaybePromise } from "elysia";
import { BunAdapter } from "elysia/adapter/bun";
import { isNumericString } from "elysia/utils";
import { ReadStream as NodeReadStream } from "node:fs";
import {
createSecureServer,
type Http2ServerRequest,
@hopeseekr
hopeseekr / StackOverflow Stats.md
Last active March 25, 2025 01:49
StackOverflow Dec 2024 stats

Disclaimer: I'm in the Top 1% of StackOverflow contributors with 23,315 rep points.

I asked 1 high-quality question in 2024, and it was closed almost immediately, and I haven't engaged with the site since.

If someone with 20,000+ karma has their nicely-formatted questions closed so quickly, what must the newbies and rank-in-file encounter? This is probably a big reason why it's declining.


@vitaly-t
vitaly-t / chain-arrays.ts
Last active October 2, 2024 13:45
Logically concatenates arrays
/**
* Iterable arrays chain, extended for "getLength" and "at" accessor.
*/
export interface IArraysChain<T> extends RelativeIndexable<T>, Iterable<T> {
/**
* Calculates total length of all input arrays combined.
*/
getLength(): number;
}
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[338],{578:(e,t,r)=>{e.exports=r.p+"7cf7ced34f0a1ece31b4.wasm"},338:(e,t,r)=>{var n;r.r(t),r.d(t,{default:()=>a});const a=(n="file:///private/tmp/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs",function(e={}){var t,a,o=e;function i(e){e={log:e||function(){}};for(const t of i.za)t(e);return o.quickJSEmscriptenExtensions=e}o.ready=new Promise(((e,r)=>{t=e,a=r})),i.za=[],o.quickjsEmscriptenInit=i,i.za.push((e=>{e.getWasmMemory=function(){return Q}}));var _,u=Object.assign({},o),l="./this.program",s="object"==typeof window,f="function"==typeof importScripts,S="";(s||f)&&(f?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),n&&(S=n),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",f&&(_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var c,T=o.print||con