Skip to content

Instantly share code, notes, and snippets.

View CrabDude's full-sized avatar

Adam Crabtree CrabDude

View GitHub Profile
/*
pins: [{
id, height
}]
*/
// orderedByHeight = [{height: 0, index: 0}]
// Output: datastructure to describe pins
function layoutPins(pins, cols) {
// [{height: 0, index: 0}]
@CrabDude
CrabDude / week1_exercise.md
Created August 12, 2016 21:43
[Sample Exercise] Week 1: Parallel Asynchronous recursiveReaddir

Week 1 Challenge - Parallel Asynchronous recursiveReaddir

This exercise is to build an API for recursively listing the files in a directory in parallel, or in other words, a recursive ls. The purpose of this exercise is to practice control-flow for asynchronous IO, specifically running operations in serial and parallel. Additionally, this exercise will explore the fs filesystem module from core.

IMPORTANT: Review the Control-flow Guide to familiarize yourself with async/await. Ignore Promise and callbacks for now.

Getting Started

The checkpoints below should be implemented as pairs. In pair programming, there are two roles: supervisor and driver.

Creating the Proxy Server

The pre-work incorporates a few steps:

  1. Setup your Node.js environment
  2. Complete the introductory NodeSchool.io Workshoppers
  3. Build a proxy server and setup logging
  4. Develop a command-line interface (CLI) to configure the server
  5. Submit the project for review via Github
  6. Extend your proxy server with additional functions
@CrabDude
CrabDude / README.md
Created September 30, 2016 09:59
An example of a proper README.md for submission.

Proxy Server

This is a Proxy Server for Node.js submitted as the pre-work requirement for the Node.js Bootcamp.

Time spent: 3h

Completed:

  • Required: Requests to port 8000 are echoed back with the same HTTP headers and body
  • Required: Requests/reponses are proxied to/from the destination server
@CrabDude
CrabDude / webGuildYarnLab.md
Created March 27, 2017 19:06
Use yarn to create a new project and manage dependencies.

WebGuild: Yarn Lab

The yarn lab incorporates a few steps:

  1. Install yarn
  2. Create a new project with yarn
  3. Installing/reinstall/syncing project dependencies
  4. Add/remove/update some dependencies

Questions? If you have any questions, ping #webguild.

Week 1 - Command Line Interfaces (CLIs)

This week, we'll ensure our environments are properly setup and walk through the fundamentals of the node.js runtime with a focus on asynchronous programming, control-flow and IO. We'll keep things simple by sticking primarily to the filesystem, stdin and stdout to write basic CLIs like an asynchronous recursive readdir CLI.

Assignment

Assignment 1: Filesystem CLIs due at 10:00pm

This week, we'll build a collection of common filesystem CLIs. The purpose of this project is to develop a basic understanding of control-flow and the node.js runtime, module system and ascyhronous APIs.