Skip to content

Instantly share code, notes, and snippets.

View nexdrew's full-sized avatar

Andrew Goode nexdrew

View GitHub Profile
@nexdrew
nexdrew / docker-compose.yml
Created August 9, 2023 20:49
docker compose config for simple 3-node insecure cockroach cluster
version: "3"
services:
db1:
image: "cockroachdb/cockroach:v23.1.8"
container_name: db1
hostname: db1
restart: on-failure
ports:
- "26257:26257"
@nexdrew
nexdrew / redis-server
Created April 29, 2015 23:57
Example files for running Redis on CentOS 7 (after manual install)
/var/lib/redis/logs/redis.log {
daily
rotate 14
copytruncate
delaycompress
compress
notifempty
missingok
}

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 / replicate-package.sh
Created May 26, 2016 15:27
bash script to manually publish a public package to your private npm Enterprise registry
#!/usr/bin/env bash
trap 'exit' ERR
for PACKAGE
do
echo "$PACKAGE"
# download and extract tarball for latest version
curl `npm info $PACKAGE dist.tarball --registry https://registry.npmjs.org` | tar xz
@nexdrew
nexdrew / e2.js
Created February 7, 2019 16:34
See how bad I can fail the Elevator Saga: https://play.elevatorsaga.com/#challenge=18
{
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
@nexdrew
nexdrew / issue21-schedule-delivery.js
Created July 13, 2018 12:56
Example of nested commands for sywac/sywac#21
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 19:42
A picturesque guide to installing Node.js on your local computer

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.

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).

function combine (one, two) {
return one + two
}
function hello (name) {
return 'Hello ' + (name || 'World')
}