Quickly-made, small, pseudorandom number generation, based on least significant bit of performance delta over a provided loop size.
This file contains 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
# yoinked from arch /etc/profile | |
append_path () { | |
case ":$PATH:" in | |
*:"$1":*) | |
;; | |
*) | |
PATH="${PATH:+$PATH:}$1" | |
esac | |
} |
This file contains 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
gas gas gas im gonna step on the gas |
This file contains 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
#!/bin/bash | |
cmd_queue=(); | |
push_queue() { | |
cmd_queue+=("$@") | |
} | |
process_queue() { | |
for cmd in "${cmd_queue[@]}"; do | |
echo "Running command: $cmd" | |
$cmd & |
This file contains 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
#!/usr/bin/env zsh | |
set -eax | |
# Do not run this with untrusted argv! | |
# Usage Example: ./watch.sh curl -fsSL http://66117b5a7483e49ba3af.functions.localhost/log | |
A="$RANDOM" | |
B="$RANDOM" | |
while true; do | |
A="$($@)"; | |
if [[ "$B" != "$A" ]]; then |
This file contains 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
// Simple hash-rate checking proof-of-work proof-of-concept script | |
const exec = (digits) => { | |
const crypto = require('crypto'); | |
while (true) { | |
const start = performance.now(); | |
let i = 0; | |
const nextHash = () => crypto.createHash('sha512').update(`${++i}`).digest('hex'); | |
let hash = ''; | |
let target = Math.floor(Math.random() * (10 ** digits)).toString(16).padStart(digits, '0'); | |
while (!hash.startsWith(target)) { |
This file contains 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
--[[ | |
@license @legal @copyright | |
jfetch.lua - A JS-fetch-in-Lua library. | |
This library is a wrapper around the Roblox HttpService API to provide a fetch-like interface. | |
It's source code, in it's entirety, can be found at https://gist.github.com/Exponential-Workload/15efd9c864e4b60ac897392325bd7650 | |
The MIT License (MIT) | |
Copyright © 2024 Expo. |
This file contains 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
// only works for 6-digit hex codes, separated by newlines | |
const hexToRgb = v=>v.split('\n').map(line=>line.split('').map((char,idx,v)=>idx%2===0?Number(`0x${char}${v[idx+1]}`):'')).map(a=>a.filter(v=>typeof v === 'number')) | |
const hexToAnsi = v=>hexToRgb(v).map(r=>`\x1b[38;2;${r.join(';')}m`) |
This file contains 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 f; | |
let y; | |
let z; | |
let i = 0; | |
const j = ()=>{ | |
let s = ++i; | |
f = f ?? (() => s); | |
z = ()=>s++; | |
y = y ?? z; | |
} |
This file contains 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
// FHP - Force High Performance (Mode) | |
// Demands that your browser renders frames constantly, triggering a higher-performance render | |
let fps = 0; | |
let lastT = 0; | |
let mounted = false; // if in sveltekit, set this to true onMount(), and false onDestroy()! | |
const animLoop = (t) => { | |
t = t / 1000; | |
if (lastT !== 0) { | |
fps = 1 / (t - lastT); | |
} |
NewerOlder