Skip to content

Instantly share code, notes, and snippets.

View johntayl's full-sized avatar
💻

John Taylor johntayl

💻
View GitHub Profile

Keybase proof

I hereby claim:

  • I am johntayl on github.
  • I am johntayl (https://keybase.io/johntayl) on keybase.
  • I have a public key ASCDoyCeYBvbMkyWuidtDYYCi22u5rVNxJ6_0qyRj9iorgo

To claim this, I am signing this object:

var blocks = [];
for(var i = 0; i < 10; i++) {
blocks.push([i]);
}
moveAOverB(3,1);
moveAOverB(6,1);
pileAOverB(1,7);
@johntayl
johntayl / api-urls.js
Last active March 29, 2017 18:40
Express Module Router
var express = require('express');
var apiRouter = express.router();
//Becomes /api/user
apiRouter.get('/user', function (request, response) {
});
@johntayl
johntayl / validate-required-fields.js
Created March 29, 2017 16:10
Utility function to validate required properties.
/**
* Validate required fields.
*
* @param {Object} requiredFields
* @param {Object} data
*
* @throws {MissingFieldError}
* @throws {InvalidFieldTypeError}
*
* @returns {Boolean}
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AuthenticationService } from '../../shared/auth';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss'],
})
import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { API } from '../api';
@Injectable()
export class AuthenticationService {
import { Injectable } from '@angular/core';
import { Headers, Http, RequestOptionsArgs, Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
/**
* API Class
*
* @export
* @class API
*/