Skip to content

Instantly share code, notes, and snippets.

Adam Crabtree CrabDude

Block or report user

Report or block CrabDude

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View week_1.md

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.

@CrabDude
CrabDude / webGuildYarnLab.md
Created Mar 27, 2017
Use yarn to create a new project and manage dependencies.
View webGuildYarnLab.md

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.

@CrabDude
CrabDude / README.md
Created Sep 30, 2016
An example of a proper README.md for submission.
View README.md

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
View prework.md

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 / week1_exercise.md
Created Aug 12, 2016
[Sample Exercise] Week 1: Parallel Asynchronous recursiveReaddir
View week1_exercise.md

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.

View layoutPins.js
/*
pins: [{
id, height
}]
*/
// orderedByHeight = [{height: 0, index: 0}]
// Output: datastructure to describe pins
function layoutPins(pins, cols) {
// [{height: 0, index: 0}]
@CrabDude
CrabDude / asyncawait.html
Created Nov 4, 2015
BayNode Node Night 11/3/15: async/await by Adam Crabtree
View asyncawait.html
<!DOCTYPE html>
<html>
<head>
<title>Async Await</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
@CrabDude
CrabDude / README.md
Last active Aug 29, 2015
A sample Node.js Bootcamp submission README
View README.md

Proxy Server

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

Time spent: [Write the number of hours you spend here]

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
View original.js
async()=>{
// Pointless calling await because crypto.pbkdf2 returns nothing
await crypto.pbkdf2('asdf', 'salt', 4096, 512, 'sha256', function(err, key) {
if (err) throw err
user.password = key.toString('hex')
console.log(user.password)
// return key.toString('hex') // 'c5e478d...1469e50'
})
@CrabDude
CrabDude / 1_overview.md
Created Apr 10, 2015
Proxy Echo Server Overview
You can’t perform that action at this time.