This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logNumbers(start, end) { | |
for (var 1 = start; i <= end; i++) { | |
console.log(i) | |
} | |
} | |
function logRecursively(start, end) { | |
function recurse(i) { | |
console.log(i) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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!'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function adjacentElementsProduct(inputArray) { | |
var numbers = -100 | |
for (var i = 0; i < inputArray.length; i++) { | |
if (inputArray[i] * inputArray[i + 1] >= numbers) { | |
numbers = inputArray[i] * inputArray[i + 1] | |
} | |
} | |
return numbers | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var http = require('http') | |
var bl = require('bl') | |
http.get(process.argv[2], function(response) { | |
response.pipe(bl(function(err, data) { | |
if (err) { | |
console.error(err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var http = require('http') | |
http.get(process.argv[2], function(response) { | |
response.setEncoding('utf-8') | |
response.on('data', console.log) | |
response.on('error', console.log) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var readFile = require('./readFile.js') | |
var file = process.argv[2] | |
var filtered = process.argv[3] | |
readFile(file, filtered, function(err, list) { | |
if (err) { | |
return console.log(err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One part of the LG transfer to slack | |
Related: https://app.clubhouse.io/learnersguild/story/1075 | |
### Specs - addresses story 1078 | |
- [ ] Identify and replace current echo/RC API extensions and replace with SLACK HTTP API. | |
- [ ] Point the chat client code in `game` to invoke existing methods in Slack HTTP API. | |
#### Original Story Source |