find . -name "node_modules" -prune -exec rm -rf '{}' +find /dir1 -mindepth 2 -type f -exec mv -t /dir1 -i '{}' +| // Needs Bun | |
| import biome from './biome.json'; | |
| // Extracted from https://biomejs.dev/linter/rules/#recommended-rules | |
| const recommended = (await Bun.file('./recommended.txt').text()) | |
| .split('\n') | |
| .map((x: string) => x.trim()) | |
| .filter(Boolean); |
| # Enter this on local terminal to forward connections to 4007 on remote computer to 4005 on local computer | |
| ssh -R 4007:localhost:4005 [email protected] |
| git checkout --orphan <newbranch> | |
| git rm -rf . | |
| <...do work...> | |
| git add your files | |
| git commit -m 'Initial commit' |
| print( | |
| ( | |
| lambda value, cases, default: | |
| { | |
| True: lambda: cases[value], | |
| False: lambda: default | |
| }[value in cases]() | |
| )( | |
| int(input()), {1: 'case 1', 2: 'case 2', 3: 'case 3'}, 'default' | |
| ) |
| var fs = require('fs'); | |
| var http = require('http'); | |
| http.createServer(function (request, response) { | |
| var path = request.url; | |
| console.log(request.method, request.url); | |
| if (path === '/') { // Serving default page from code instead of a file. | |
| var html = "<!DOCTYPE html>" + | |
| "<html>\n" + |
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |