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 / 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.
@cheeseonamonkey
cheeseonamonkey / timestamp-hash.js
Created August 18, 2023 08:38 — forked from whoisryosuke/timestamp-hash.js
JS - Generate semi-unique hash based off timestamp
const hash = Number(new Date).toString(36)
@cheeseonamonkey
cheeseonamonkey / GetDirsContext.zsh
Last active August 13, 2023 20:41
Get Dirs Context
function print_files() {
# Check for help flag
if [[ $1 == "-h" || $1 == "--help" ]]; then
printf "Usage: print_files [-f filter] [regex]\n"
printf "Options:\n"
printf " -f filter Select files with fzf using the specified filter\n"
printf " -h Show this help message\n"
return
fi
@cheeseonamonkey
cheeseonamonkey / chatGptDSL.kt
Last active July 27, 2023 09:28
kotlin chatgpt dsl
package com.example.models
import kotlinx.serialization.*
import kotlinx.serialization.json.Json
@Serializable
data class Message(val role :String, var content :String) {
override fun toString(): String = "${(role+":").padEnd(11)} ${content}"
}
#!/bin/zsh
function write_on_terminal() {
local row=$1
local column=$2
local text=$3
# Save the cursor position
printf "\033[s"
@cheeseonamonkey
cheeseonamonkey / readlnSyncPrompt.md
Last active July 21, 2023 07:32
readline async one-liner prompt function
  1. Install the readline-sync package by running the following command in your terminal:

    npm install readline-sync
    
  2. Import the readline-sync module in your JavaScript file:

    const readlineSync = require('readline-sync');