Skip to content

Instantly share code, notes, and snippets.

View zzzbra's full-sized avatar
👺

Zach Brady zzzbra

👺
View GitHub Profile
@zzzbra
zzzbra / gist:9938c0416d6945a59acf308af16ece71
Created September 6, 2023 19:33
Delete the first line of every file in local directory if it is an empty line using gnu sed
# Need to install gnu-sed. See here: https://formulae.brew.sh/formula/gnu-sed
find /path/to/directory -type f -exec gsed -i '1{/^$/d;}' {} +
@zzzbra
zzzbra / index.js
Created January 5, 2020 04:10
Tic Tac Toe
#!/usr/bin/env node
const readline = require("readline");
const boxen = require("boxen");
const NUM_ROWS = 3;
const NUM_COLS = 3;
// Set up game loop
const rl = readline.createInterface({
function SpeedTest(testImplement, testParams, repetitions){
this.testImplement = testImplement;
this.testParams = testParams;
this.repetitions = repetitions || 10000;
this.average = 0;
}
SpeedTest.prototype = {
startTest: function(){
var beginTime, endTime, sumTimes = 0;