Skip to content

Instantly share code, notes, and snippets.

View aberonni's full-sized avatar

Domenico Gemoli aberonni

View GitHub Profile
@aberonni
aberonni / .installation.md
Last active December 21, 2024 02:09
Basic zshell greatness

Basic zshell greatness

Below is a quick-start guide to get a lot of zshell goodness. It should take you no longer than 30 minutes to go through the whole guide.

0. Why do this?

Once you've completed the below steps, you should have lots of nice goodies.

Some examples:

@aberonni
aberonni / git-bisect.md
Created May 1, 2024 07:00
Performing a git bisect

git bisect is a really useful tool when you want to answer the question "when did this thing change?" but it's hard to understand from just looking at the git logs.

The way git bisect works is that you define a "good" and a "bad" commit. The git bisect command then uses a binary search to narrow down the commit that made the repository go from "good" to "bad".

You can further make your life easier by asking git bisect to execute a script for you on each commit, automating the search, and providing the commit in question with no further manual intervention.

Below is an example, with an example script, that illustrates how git-bisect was used on the 121-platform to find the answer to the question "when did typeorm start generating nonsense migrations?".

Setup

/**
* This function is set to run on a daily trigger so that
* there is no need for manual intervention on the sheet.
*
* The trigger was set up following this guide:
* https://www.quora.com/How-can-I-periodically-run-a-Google-Script-on-a-Spreadsheet
*
* You should be able to add this script to a new google sheet that uses
* the same format by doing the following
* - open the spreadsheet you want to add this script to
@aberonni
aberonni / BMI.js
Created November 12, 2020 15:27 — forked from Reinoptland/BMI.js
BMI program for Beginner Bootcamp
const age = 31 // age
const gender = 'm' // 'm' or 'f'
const heightInM = 1.79 // height in m
const weightInKg = 82 // weight in kg
const dailyExercise = true // true or false
console.log(`
**************
BMI CALCULATOR
@aberonni
aberonni / chromedriver-repl.js
Created October 28, 2018 10:59
A script that allows you to run WebdriverIO's REPL interface with chromedriver
const { spawn } = require('child_process');
const chromedriver = require('chromedriver');
chromedriver.start(['--silent'], true).then(() => {
spawn('npx', ['wdio', 'repl', 'chrome', '--port', '9515', '--path', '/'], {
stdio: 'inherit',
}).on('exit', () => {
chromedriver.stop();
});
});