Skip to content

Instantly share code, notes, and snippets.

View bliotti's full-sized avatar
public key cryptography is pretty neat 🔑 🔐

Brian Liotti bliotti

public key cryptography is pretty neat 🔑 🔐
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Apple Trade-In Values</title>
<style>
table {
border-collapse: collapse;
width: 100%;
}
@bliotti
bliotti / main.js
Created June 3, 2025 01:17
DevTools Console Hacks
// DevTools Console Quick Bites: 10 Useful JavaScript Snippets for Developers
// 1. Click all checkboxes on the page
[...document.querySelectorAll('input[type="checkbox"]')].forEach(cb => cb.click());
// 2. Click all checkboxes with delay (helps when framework needs reactivity)
(async () => {
const checkboxes = document.querySelectorAll('input[type="checkbox"]');
for (const cb of checkboxes) {
cb.click();
@bliotti
bliotti / Dockerfile
Created February 6, 2025 12:14
unning-ubuntu-os-with-gui-in-a-docker-container
https://medium.com/cloud-for-all/running-ubuntu-os-with-gui-in-a-docker-container-rdp-dbecb0880893
FROM ubuntu:22.04
# Install dependencies, Lubuntu desktop, and XRDP
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y \
lubuntu-desktop xrdp sudo && \
apt clean && rm -rf /var/lib/apt/lists/*
@bliotti
bliotti / idk
Created September 24, 2024 08:16
idk: a tldr tool
#!/bin/bash
curl "http://cheat.sh/$1"
sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
@bliotti
bliotti / machine
Last active August 30, 2024 21:01
What machine am I?
#!/usr/bin/env bash
lsb_release -a
echo
cat /etc/os-release
echo
uname -a
# EXAMPLE OUTPUT
#
@bliotti
bliotti / README.md
Created August 30, 2024 19:05
bit axe API

Run these from your terminal

curl http://192.168.1.170/api/system/info

curl http://192.168.1.170/api/swarm/info

curl -X POST http://192.168.1.170/api/system/restart

curl https://api.github.com/repos/skot/esp-miner/releases
@bliotti
bliotti / readme.sh
Created February 27, 2024 17:17
fix backspace
# fix either in bash
# ~/.bashrc
bind '"\C-H":backward-kill-word'
# or in wt.exe (Windows Terminal)
# // %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
{
"actions": [
@bliotti
bliotti / generateCardImage.js
Created May 6, 2023 03:43
Stack images with canvas
....
const generateCardImage = async (cardNumber, cardChoices) => {
const canvas = createCanvas(format.width, format.height);
const ctx = canvas.getContext("2d");
console.log("Creating #", cardNumber)
ctx.clearRect(0, 0, format.width, format.height);
ctx.globalAlpha = 1;