Skip to content

Instantly share code, notes, and snippets.

View cheeseonamonkey's full-sized avatar
😅
Sweating, and smiling

Alexander H cheeseonamonkey

😅
Sweating, and smiling
View GitHub Profile
@cheeseonamonkey
cheeseonamonkey / GithubReadmeTemplate.md
Created May 5, 2024 00:16
github readme template (source: /othneildrew/Best-README-Template/)

@cheeseonamonkey
cheeseonamonkey / downloadWikiDumps.js
Created April 27, 2024 02:07
Wikipedia dumps download script
/*
npm install axios cheerio fs-extra
*/
// Import the necessary libraries
const axios = require('axios');
const cheerio = require('cheerio');
const fs = require('fs-extra');
const path = require('path');

usage:

ui:

image

shell:

    py wiki_to_text.py '/hdd/Downloads/simplewiki-20240120-pages-meta-current.xml.bz2' `pwd`/output/
@cheeseonamonkey
cheeseonamonkey / scalers.py
Last active March 6, 2024 00:03
python scalers and transforms cheatsheet
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler, MaxAbsScaler, Normalizer
# Generate demonstration data ensuring positivity
better_datasets = [
np.random.rand(100, 2) * 20 + 10,
np.random.rand(100, 2) * 100,
np.random.beta(100, 2, size=(100, 2)),
np.random.f(100, 2, size=(100, 2)),
@cheeseonamonkey
cheeseonamonkey / Float32_Base64_Encoding_Decoding.js
Created December 23, 2023 08:51 — forked from sketchpunk/Float32_Base64_Encoding_Decoding.js
Encode Float32Array to base64 , then decode it back
let verts = new Float32Array( [ 0, 2, 0, -1, 0.2, 0, 1, 0.2, 0 ] );
let v = base64_test( verts );
function base64_test( fary ){
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ENCODING TEST
console.log("Origin Data", fary );
let uint = new Uint8Array( fary.buffer );
console.log( "Convert F32 to Uint8 : Byte Length Test", fary.length * 4, uint.length );
@cheeseonamonkey
cheeseonamonkey / power_cycle_usb.zsh
Last active November 10, 2023 00:20
power_cycle_usb devices programatically (unplug, wait a short moment, then plug it back in; originally for use troubleshooting mobile tethering)
power_cycle_usb() {
# Check if no arguments are passed
if [[ $# -eq 0 ]]; then
power_cycle_usb -h;
return;
fi;
# Define local variables
local quiet=false verbose=false help=false sleep_time=0.5 wait_finish=true choice=false device
local RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[0;33m' BLUE='\033[0;34m' NC='\033[0m'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>File Upload and Regex Matcher</title>
<!-- Include jQuery for simplicity -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Include FileSaver.js CDN for saving results -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
Font Name Description Common Uses Vibes
Lato A modern, clear font with strong structure Web design, print, corporate identity Professional, clean
Martel Sans A versatile, easy-to-read font Digital media, advertising, logos Friendly, approachable
Nunito Sans A light, rounded font User interfaces, mobile apps, children's books Soft, playful
Quicksand A geometric, light font Posters, logos, print media Modern, minimalist
Rubik A bold, cube-like font Headings, logos, signage Strong, impactful
Varela Round A rounded, sans-serif font Web design, mobile apps, logos Casual, friendly
Open Sans A humanist sans-serif font Web and print design, mobile apps Neutral, simple
Roboto A mechanical sans-serif font User interfaces, mobile apps, web design Modern, geometric
@cheeseonamonkey
cheeseonamonkey / bt-da.sh
Last active August 23, 2023 08:36
bluetooth de-auth
#!/usr/bin/bash
# Check if running as root.
function check_sudo() {
if [[ "$EUID" -ne 0 ]]; then
clear
echo " This script must be run as root!"
exit 1
const quasiHash = (ms: number = 1, d: Date = new Date()) => ( // 3-digit, semi-unique timehash
Number(Number(d).toString().slice(-3)).toString(36) +
Number(Math.floor(Math.random() * 35) + 1).toString(36)
)
// examples outputs: gc6, szb, c0r, etc.