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 { randomBytes } from "node:crypto"; | |
import { Readable as ReadableStream } from "node:stream"; | |
import fs from "node:fs"; | |
import bytes from "bytes"; | |
function createRandomBytesReadableStream(sizeInBytes) { | |
return new ReadableStream({ | |
read(readSize) { | |
readSize = Math.min(readSize, sizeInBytes); |
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 { buffer } from "node:stream/consumers"; | |
import { randomBytes } from "node:crypto"; | |
import { Readable as ReadableStream } from "node:stream"; | |
import fs from "node:fs"; | |
import http from "node:http"; | |
import https from "node:https"; | |
import path from "node:path"; | |
import { program } from "commander"; | |
import bytes from "bytes"; |
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
// Эмулятор бас-бочки для электронных барабанов от 2х сустейн педалей | |
// Сустейн педали выполняют роль кнопок, замыкая цепь, подключаются к KICK_1_PIN и KICK_2_PIN через какой-нибудь резистор | |
// Как симуляция удара по бочке (триггеру) генерируется ШИМ импульс на пине OUTPUT_KICK_PIN в течении KICK_WAVE_DURATION_MS (подается HIGH на цифровой пин) | |
// После нажатия на педаль (регистрирования замыкания цепи) до следующего нажатия этой же педали необходимо, чтобы прошло минимум KICK_TRIGGER_COOLDOWN_MS | |
// Джек для выхода сигнала на электронные барабаны подключается к OUTPUT_KICK_PIN и GND | |
// При регистрировании нажатия на педали на Ардуине так же дублировочно будет мигать светодиод L (т.к. он соединен с пином 13) |
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
/* | |
Примитивный тестер с диодом | |
Схема | |
Из соседних GND и 13го пина - вставить диод | |
От GND около 13го пина любой резистор в 7й пин | |
Из 7го пина провод и из 5v провод |
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
// Program infinite prints line 0000...00000 (120 width), and add 1 to this binary number representation | |
// You will see "live binary counter" | |
// 137 byte c++ code | |
#include<cstdio> | |
int w=120,b[120],k,i,t;int main(){for(;;)for(k=1,i=0;i<w;t=b[i],printf("\x1b[0;%dH%d",w-1-i,t),b[i++]=k?!t?k=0,1:0:t);} |
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 crypto from "node:crypto"; | |
function gf(init) { | |
let r = new Float64Array(16); | |
if (init) { | |
for (let i = 0; i < init.length; ++i) { r[i] = init[i]; } | |
} | |
return r; | |
} |
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 fs from "node:fs"; | |
import path from "node:path"; | |
const autioLibraryFolder = process.argv[2]; | |
const useParts = Boolean(process.argv.find(arg => arg === "-p")); | |
if (!fs.existsSync(autioLibraryFolder)) throw new Error("Folder does not exist"); | |
const compareStrings = (a, b) => a.localeCompare(b); |
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 crypto from "crypto"; | |
const { publicKey, privateKey } = crypto.generateKeyPairSync("rsa", { | |
modulusLength: 512, | |
publicKeyEncoding: { | |
type: "spki", | |
format: "pem" | |
}, | |
privateKeyEncoding: { | |
type: "pkcs8", |
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
let processUnique = Buffer.allocUnsafe(5); | |
for (let i = 0; i < processUnique.length; i++) processUnique[i] = Math.floor(Math.random() * 0xff); | |
let index = Math.floor(Math.random() * 0xffffff); | |
const buffer = Buffer.allocUnsafe(12); | |
function getInc() { | |
return (index = (index + 1) % 0xffffff); | |
} |
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 { spawn } from "node:child_process"; | |
import ndapp from "ndapp"; | |
import filenamifyLibrary from "filenamify"; | |
async function executeShellCommand(cmd) { | |
return new Promise((resolve, reject) => { | |
const child = spawn(cmd, { shell: true }); | |
child.stdout.on("data", data => console.log(data.toString())); |
NewerOlder