Skip to content

Instantly share code, notes, and snippets.

View jonfazzaro's full-sized avatar
💭
Probably off looking for a cup of coffee.

Jon Fazzaro jonfazzaro

💭
Probably off looking for a cup of coffee.
View GitHub Profile
What I call it Symbol What a grown-up might call it
Banana ( or ) Parenthesis
Football () Open/closed parentheses
Mustache { or } Curly Brace
Goatee {} Open/closed curly braces
Staple [ or ] Square bracket
Box [] Open/closed square brackets
Alligator < or > Angle bracket
Alligators kissing &lt;&gt; Open/closed angle brackets OR fragment
@jonfazzaro
jonfazzaro / vitest-init
Last active March 14, 2025 20:05
An init script for vitest/react/TypeScript
#! /bin/bash
function main() {
install_packages
add_setup
add_configuration
configure_compilation
add_test_script
}
@jonfazzaro
jonfazzaro / git-ci
Created September 10, 2024 13:37
A git script for quick continuous integration in an ensemble.
#!/bin/bash
MESSAGE=$1
pushd () {
command pushd "$@" > /dev/null
}
popd () {
command popd "$@" > /dev/null
@jonfazzaro
jonfazzaro / git-churn
Last active August 3, 2022 15:21 — forked from alanwillms/git-churn
See the top 10 most changed files in your repository.
#!/bin/bash
#
# Written by Corey Haines
# Scriptified by Gary Bernhardt: https://github.com/garybernhardt/dotfiles/blob/master/bin/git-churn
#
# Put this anywhere on your $PATH (~/bin is recommended). Then git will see it
# and you'll be able to do `git churn`.
#
# Show churn for whole repo:
# $ git churn
@jonfazzaro
jonfazzaro / swatch.sh
Created July 13, 2022 14:31
Do a thing when files change.
/usr/local/bin/fswatch -or -e ".git" -0 . | xargs -0 -n 1 -I {} /bin/zsh -c $1
@jonfazzaro
jonfazzaro / AwfullySpecificAndroidAssertions.kt
Created June 23, 2022 21:41
Use this assertion to test if a Kotlin class has a HiltViewModel annotation.
import org.junit.jupiter.api.Assertions.assertNotNull
inline fun <reified T : Any> assertIsHiltViewModel() {
assertNotNull(Class.forName("${T::class.qualifiedName}_HiltModules"))
}
class Verse:
def create(bottles):
return {
0: UltimateVerse(),
1: PenultimateVerse()
}.get(bottles, Verse(bottles))
def __init__(self, bottles):
self.bottles = bottles
@jonfazzaro
jonfazzaro / beer.py
Last active February 28, 2022 18:40
def number(bottles):
return str(bottles) if 0 < bottles else "No"
def bottlesOfBeer(bottles):
s = "" if bottles == 1 else "s"
return f"{number(bottles)} bottle{s} of beer"
def passOne(bottles):
@jonfazzaro
jonfazzaro / fan.ps1
Created June 28, 2018 12:32
A script for running multiple processes in parallel.
param(
[String[]] $Files,
[String] $Run
)
$processes = @()
foreach ($f in $Files) {
$processes += Start-Process -FilePath $Run -ArgumentList $f -PassThru
}
public class Encrypted {
public string Value { get; set; }
public string Salt { get; set; }
}