Skip to content

Instantly share code, notes, and snippets.

View adaptive-shield-matrix's full-sized avatar

Adaptive Shield Matrix adaptive-shield-matrix

View GitHub Profile
@gtrabanco
gtrabanco / bun-sse.ts
Created November 15, 2022 15:00
Bun Server Sent Events
// bun --hot sse.ts
import { randomUUID } from "node:crypto";
import { EventEmitter } from "node:events";
const sseEvents = new EventEmitter();
export const sse = (data) => {
sseEvents.emit(
"sse",
`id: ${randomUUID()}\ndata: ${JSON.stringify(data)}\n\n`
@stif
stif / http-server.js
Last active April 1, 2024 04:10
node.js HTTP Server
import * as http from 'http'
import { URL } from 'url'
import { stat, readFile } from 'fs/promises';
import { join, extname } from 'path';
// you can pass the parameter in the command line. e.g. node http_server.js 3000
const port = process.argv[2] || 9000;
// maps file extention to MIME types
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active April 9, 2025 13:42
Front-end frameworks popularity (React, Vue, Angular and Svelte)