Skip to content

Instantly share code, notes, and snippets.

@2sh
2sh / lsb_first_convert.js
Last active September 29, 2024 10:17
Fast least significant bit first bit array conversion in Javascript
function numToBits(num, length=8)
{
const bits = Array(length)
for (let i=0; i<length; i++)
{
bits[i] = n >> i & 1
}
return bits
}
#!/bin/bash
set -e
hosts=()
hosts[0]="<host> <domain> <password>"
cache_dir=/var/lib/misc/namecheap-dns-update
@2sh
2sh / kokanu.mjs
Created September 8, 2023 22:55
#!/usr/bin/env node
// pdf2svg Logography\ for\ Kokanu.pdf input/kokanu_%d.svg all
// node kokanu.mjs pre
// node kokanu.mjs post
import fs from 'fs/promises'
import fsx from 'fs'
import readline from 'readline'