Skip to content

Instantly share code, notes, and snippets.

View pllearns's full-sized avatar

Phillip Lorenzo pllearns

  • FYC Labs
  • Portland, OR
View GitHub Profile
@pllearns
pllearns / routes.js
Created May 11, 2017 01:55
Difficulty with Express Routes
// This was the solution that I found on Stack Overflow after google searching express routes with api
var express = require('express')
var router = express.Router(); // Create our Router Middleware
// GET / route
router.get('/', function(req, res) {
return res.status(200).send('GET /api received!');
});
@pllearns
pllearns / PersonalWebsiteGoal.md
Last active May 12, 2017 21:49
Cycle 42 - Specs

Repo for Personal Website

NOTE: I will be publishing the personal site this weekend through a domain name and through the now domain platform.
@pllearns
pllearns / shortestPathWithEdge.js
Created May 18, 2017 22:49
Google Interview Question -- initial implementation of shortestPathWithEdge
function shortestPathWithEdge(start, finish, weight, graph) {
const results = {}
const possible = Infinity
let edges = getEdges(finish)
while (edges.length > 0) {
edge = edges.shift()
if(results[edge.v].cost === Infinity) {
results[edge.v] = {cost: edge.c, stack:[edge.v]}
function logNumbers(start, end) {
for (var 1 = start; i <= end; i++) {
console.log(i)
}
}
function logRecursively(start, end) {
function recurse(i) {
console.log(i)
@pllearns
pllearns / stackNew.js
Created May 20, 2017 23:45
Stack in ES6
'use strict'
class Stack {
constructor(capacity) {
this._capacity = capacity || Infinity
this._storage = {}
this._count = 0
}
push(value) {
@pllearns
pllearns / InitialSpecs.md
Last active May 23, 2017 17:55
Week 49 - Get Hired Goal

Get Hired Specs - Week 49

  • Complete one codeFight per day
  • Apply to 10 jobs outside of Hired.com
  • Complete at least one interview from Hired.com
  • Write a blog on Webpack for Sweetcode.io
@pllearns
pllearns / countingCards.js
Created June 7, 2017 00:52
FreeCodeCamp Exercise Solutions
var count = 0;
function cc(card) {
// Only change code below this line
switch(card) {
case 2:
case 3:
case 4:
case 5:
case 6:
@pllearns
pllearns / SPECS.md
Last active June 9, 2017 21:33
Final Week - Get Hired
@pllearns
pllearns / httpClient.js
Last active July 7, 2017 22:41
Learn You Node exercises
var http = require('http')
http.get(process.argv[2], (res) => {
res.setEncoding('utf8')
res.on('data', console.log)
res.on('error', console.error)
}).on('error', (e) => {
console.error(`Got error: ${e.message}`)
})