Skip to content

Instantly share code, notes, and snippets.

View LucianBuzzo's full-sized avatar
👹
Plate Armor Enthusiast

Lucian Buzzo LucianBuzzo

👹
Plate Armor Enthusiast
View GitHub Profile
@LucianBuzzo
LucianBuzzo / hanoi.js
Created April 2, 2025 12:57
tower of hanoi solver
const state = [
[5, 4, 3, 2, 1],
[],
[]
]
const A = 0;
const B = 1;
const C = 2;
@LucianBuzzo
LucianBuzzo / genius.spec.ts
Created March 3, 2025 15:26
Genius song lyrics scraper
import { test } from "@playwright/test";
const userAgent =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36";
test.use({
userAgent,
});
test("Genius", async ({ page }) => {
name: Tagged Commit Check
on:
pull_request:
branches:
- <protected_branch_name>
jobs:
check-tagged-commit:
runs-on: ubuntu-latest
@LucianBuzzo
LucianBuzzo / text.js
Created March 20, 2023 10:08
test text for cracking caesar cipher
exports.text =`
Improved own provided blessing may peculiar domestic. Sight house has sex never. No visited raising gravity outward subject my cottage mr be. Hold do at tore in park feet near my case. Invitation at understood occasional sentiments insipidity inhabiting in. Off melancholy alteration principles old. Is do speedily kindness properly oh. Respect article painted cottage he is offices parlors.
Mind what no by kept. Celebrated no he decisively thoroughly. Our asked sex point her she seems. New plenty she horses parish design you. Stuff sight equal of my woody. Him children bringing goodness suitable she entirely put far daughter.
Contented get distrusts certainty nay are frankness concealed ham. On unaffected resolution on considered of. No thought me husband or colonel forming effects. End sitting shewing who saw besides son musical adapted. Contrasted interested eat alteration pianoforte sympathize was. He families believed if no elegance interest surprise an. It abode wrong miles an so delay pl
@LucianBuzzo
LucianBuzzo / recursive-caesar-cipher.js
Created March 15, 2023 13:25
Recursive Caesar Cipher
const recursiveCaesarCipher = (shift, text) => {
const inner = (shift, [ letter, ...rest]) => {
const index = alphabet.indexOf(letter);
const newIndex = (index + shift) % alphabet.length;
return [
index >= 0 ? alphabet[newIndex] : letter,
...rest.length ? inner(shift, rest) : []
]
}
const primeSeive = (n) => {
const primes = []
// Start with an array of all numbers between 2 and n
let buf = Array(n - 1).fill().map((_, i) => i + 2);
let pointer = 0;
while (pointer < buf.length) {
const p = buf[pointer];
// Push the prime
primes.push(p);
@LucianBuzzo
LucianBuzzo / reference.txt
Created July 20, 2021 12:16
useful blog posts
https://journal.stuffwithstuff.com/2009/06/05/naming-things-in-code/
https://journal.stuffwithstuff.com/2016/06/16/long-names-are-long/
@LucianBuzzo
LucianBuzzo / alias.txt
Last active January 17, 2020 10:48
git alias'
[alias]
push-force = push --force-with-lease
tree = log --graph --decorate --pretty=oneline --abbrev-commit --all
scratch-commit = commit -m \"fixup\"
signoff = commit --amend --signoff
alias = config --get-regexp ^alias\\.
# from https://gist.github.com/hkaj/97c16a9ec6df6e6f1e18
checkoutpr = "!f() { git fetch origin refs/pull/$1/head:pr/$1; git checkout pr/$1; } ; f"
checkoutcontrib = "!f() { git checkout master && git pull && git remote add $1 git@github.com:$1/dd-agent && git fetch $1 $2 && git checkout -b $3 $1/$2 && git rebase master } ; f"
delete-merged-branches = "!f() { git checkout --quiet master && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f"
@LucianBuzzo
LucianBuzzo / main.py
Created March 8, 2019 16:17
Retrieve Balena app git url
import os
from balena import Balena
balena = Balena()
token = os.environ['TOKEN']
appId = os.environ['APP_ID']
balena.auth.login_with_token(token)
user = balena.auth.who_am_i()
app = balena.models.application.get(appId)