Skip to content

Instantly share code, notes, and snippets.

View sethuster's full-sized avatar

Seth Urban sethuster

View GitHub Profile
@sethuster
sethuster / pizza_topping_combo_rank.js
Created May 16, 2019 15:43
Pizza Topping Combination Rank
// Assuming you have a json file named pizzas.json in the same directory as this script
// and the JSON file is a list of objects { "toppings" : ["topping1", "topping2"] }
// Determine the 20 most popular pizza topping combinations.
// Output the Combinations, the number of times the combination has been ordered,
// and the number of times the topping has been used
const fs = require('fs');
const pizzaFile = JSON.parse(fs.readFileSync('./pizzas.json', 'utf8'))
let search = '';
let uniqToppings = []
@sethuster
sethuster / package.json
Created May 6, 2019 18:19
Webdriver.io REPL Project
{
"name": "webdriverio-repl",
"version": "0.0.1",
"description": "webdriver.io v5 repl project",
"dependencies": {
"@wdio/cli": "5.7.15",
"@wdio/selenium-standalone-service": "5.7.8",
"@wdio/sync": "5.8.1"
}
}
@sethuster
sethuster / start_verdaccio
Created April 30, 2019 23:28
Verdaccio Startup Script
#!/bin/bash
echo -e "Starting Verdaccio local node repository..."
docker run -d --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
echo -e "Verdaccio started at: http://localhost:4873"
echo -e "Make sure you add a local user"
echo -e "npm adduser --registry http://localhost:4873"
@sethuster
sethuster / package.json
Created April 30, 2019 23:06
File path package.json
{ "dependencies" :
{
"myModule" : "file:../relative/path/to/myModule"
}
}
@sethuster
sethuster / node_nuker.sh
Created April 30, 2019 22:51
Node Nuker script to automatically destroy node_modules and reinstall.
#!/bin/bash
echo -e "Removing node_modules directory"
rm -rf node_modules
echo -e "Removing package-lock.json"
rm package-lock.json
echo -e "Reinstalling modules"
npm install