Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Goode nexdrew

View GitHub Profile
View workout_components.md

Components of a workout description:

  • One or more "sets" of:
    • Name
    • Type? Body area?
    • Description/purpose
    • A number of "positions"
      • 1 starting (graphic)
      • 1 ending (graphic)
      • 0 or more in between start and end
@nexdrew
nexdrew / e2.js
Created Feb 7, 2019
See how bad I can fail the Elevator Saga: https://play.elevatorsaga.com/#challenge=18
View e2.js
{
init: function (elevators, floors) {
const numVators = elevators.length
// const numFloors = floors.length
const FILTER_BEFORE = true
const FILTER_AFTER = true
const AGGRESSIVE_FILTER = false
const STOP_ZERO = true
const IDLE_ZERO = true
const DIRECT_ZERO = true
View issue21-schedule-delivery.js
module.exports = {
flags: 'schedule-delivery',
desc: 'Launch scheduled mail delivery, max of three days in advance.',
setup: sywac => {
sywac
.showHelpByDefault(false) // disable this here since schedule-delivery is a runnable command
.option('-l, --email-list <email-list>', {
type: 'string',
desc: 'The mailgun email list you would like to use.',
strinct: true, // this is misspelled, and strict does not apply to strings; use `required: true` to require this option
@nexdrew
nexdrew / install-node.md
Last active May 4, 2017
A picturesque guide to installing Node.js on your local computer
View install-node.md

Installing Node.js

Windows

A: Download the Node.js Windows Installer

  1. Go to https://nodejs.org/en/download/current/ in your favorite web browser.

  2. Click on the big green Windows Installer button to download the installer.

View git_basics.md

Git Basics

Git is a system for storing changes to files in a repository consisting of one or more branches.

Let's briefly define what each of these terms mean.

Repository

A repository is basically just metadata for a directory (or folder) on your local file system. Just like you can have many directories on your file system, you can have many git repositories on your computer. You can think of a repository as a way to store information about the contents of a particular directory (and the changes made to those contents over time).

View combine.js
function combine (one, two) {
return one + two
}
function hello (name) {
return 'Hello ' + (name || 'World')
}
@nexdrew
nexdrew / republish.sh
Last active Nov 29, 2016 — forked from soldair/republish.sh
publish modules from the public registry to another registry
View republish.sh
#!/bin/bash
mkdir -p ./publish-tmp
cd publish-tmp
if [ "$?" != "0" ]; then
echo "failed to create publish tmp dir"
exit 1
fi
@nexdrew
nexdrew / npme-users.js
Created Oct 26, 2016
Node executable script that prints a list of all known users for an npm Enterprise instance (should be run on the npme host)
View npme-users.js
#!/usr/bin/env node
// assumes that the Docker bridge is using ip 172.17.0.1
var client = require('redis').createClient('redis://172.17.0.1:6379')
var users = {}
client.keys('user-*', function (err, keys) {
var numKeys = keys.length
var numChecked = 0
keys.forEach(function (key) {
client.get(key, function (err, value) {
@nexdrew
nexdrew / virtual_appliance.md
Last active Sep 19, 2016
Install npm Enterprise as a virtual appliance
View virtual_appliance.md

Open Virtualization Format

npm Enterprise can now be installed as a virtual appliance conforming to the Open Virtualization Format. If you already use a hypervisor or virtualization platform for your infrastructure (such as VMware), you can import and run an instance of this virtual appliance as a host VM instead of installing npm Enterprise on one of your existing hosts.

The appliance is distributed as an .ova file, which is essentially a tarball containing a virtual machine template (.ovf file), a virtual hard drive (.vmdk file), and a manifest (.mf file). Download the virtual appliance here.

Once you have downloaded the virtual appliance, check for binary completeness by comparing a SHA256 checksum of your download against the respective checksum file listed.

Virtual Appliance Default Specs