Skip to content

Instantly share code, notes, and snippets.

View skwid138's full-sized avatar
Tiger Style

Hunter Rancourt skwid138

Tiger Style
View GitHub Profile
redestructa / TablePrinter.php
Created February 13, 2019 10:42
The table Printer class has no dependencies and generates an array out of an object array
* The table Printer class has no dependencies and generates an array (strings)
* out of an object array / countable and the child properties that should be printed given by an array (strings)
class TablePrinter
* @param \Countable|array|object[] $historyItems
AmreeshTyagi /
Last active April 20, 2024 19:05
Exclude MySQL Workbench from dark theme with mojave Mac dark theme
defaults write NSRequiresAquaSystemAppearance -bool yes
echo "Successfully patched!"
echo "Now restart MySQL Workbench to see the Workbench in light theme."
#Restart MySQL Workbench after executing this.
skwid138 /
Last active June 23, 2020 15:36
Git How far local branch is behind/ahead of remote branch
# Use -r to compare against a remote branch
## Example w/o this script
## git fetch --all | git rev-list --left-right --count origin/master...master
$USAGE="$0 [-r <remote branch>]"
rhukster /
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to
# Creator: Phil Cook
# Modified: Andy Miller
# >>> IMPORTANT: Moved to:
# >>> Kept here for legacy purposes
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
bob-lee / polyfill-ie11-nodelist-foreach.js
Created November 24, 2017 18:41
Polyfill for IE11 missing NodeList.forEach
if ('NodeList' in window && !NodeList.prototype.forEach) {'polyfill for IE11');
NodeList.prototype.forEach = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {, this[i], i, this);
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
spalladino / monitor.js
Created October 15, 2017 23:15
Configure ngrok with nodemon for local development
#!/usr/bin/env node
if (process.env.NODE_ENV === 'production') {
throw new Error("Do not use nodemon in production, run bin/www.js directly instead");
const nodemon = require('nodemon');
const ngrok = require('ngrok');
// We start an ngrok tunnel to ensure it stays the same for the entire process
sdnts /
Last active January 10, 2023 20:50
Postman pm.sendRequest example

To send a request via the sandbox, you can use pm.sendRequest.

pm.test("Status code is 200", function () {
    pm.sendRequest('', function (err, res) {
        pm.expect(res)'code', 200);
        pm.expect(res)'status', 'OK');
matthewjberger /
Last active March 11, 2024 10:21
How to make an electron app using Create-React-App and Electron with Electron-Builder.
shashankmehta /
Last active January 7, 2024 11:57
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer