Skip to content

Instantly share code, notes, and snippets.

View Exponential-Workload's full-sized avatar
:shipit:
i'm the reason we cant have nice things in life

Expo Exponential-Workload

:shipit:
i'm the reason we cant have nice things in life
View GitHub Profile
# yoinked from arch /etc/profile
append_path () {
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${PATH:+$PATH:}$1"
esac
}
gas gas gas im gonna step on the gas
#!/bin/bash
cmd_queue=();
push_queue() {
cmd_queue+=("$@")
}
process_queue() {
for cmd in "${cmd_queue[@]}"; do
echo "Running command: $cmd"
$cmd &
@Exponential-Workload
Exponential-Workload / watch.sh
Last active April 6, 2024 21:52
watch.sh: A simple script for getting up-to-date command output faster, without stdout flickering
#!/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
@Exponential-Workload
Exponential-Workload / powpoc.cjs
Last active March 9, 2024 02:35
Small Proof-of-Work Proof-of-Concept
// 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)) {
@Exponential-Workload
Exponential-Workload / fetch.lua
Last active February 29, 2024 23:18
fetch.lua: A Roblox fetch() library for ts/js enjoyers - luadoc types included
--[[
@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.
// 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`)
@Exponential-Workload
Exponential-Workload / README.md
Last active November 21, 2023 09:20
Performance-Least-Significant-Bit-based RNG in JS

Exporng

Quickly-made, small, pseudorandom number generation, based on least significant bit of performance delta over a provided loop size.

@Exponential-Workload
Exponential-Workload / scope.js
Last active October 27, 2023 10:24
Scope Functionality Testing Thing
let f;
let y;
let z;
let i = 0;
const j = ()=>{
let s = ++i;
f = f ?? (() => s);
z = ()=>s++;
y = y ?? z;
}
@Exponential-Workload
Exponential-Workload / hpa.js
Created October 25, 2023 16:28
Force High-Performance
// 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);
}