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
var dataset = require('./dataset.json'); | |
/* | |
create an array with accounts from bankBalances that are | |
greater than 100000.00 | |
assign the resulting array to `hundredThousandairs` | |
*/ | |
var hundredThousandairs = dataset.bankBalances.filter(function(bank) { | |
return parseInt(bank.amount) > 100000; | |
}); |
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
### Keybase proof | |
I hereby claim: | |
* I am joekarlsson on github. | |
* I am joekarlsson (https://keybase.io/joekarlsson) on keybase. | |
* I have a public key whose fingerprint is E626 4B25 7B52 A96C 71D3 8B69 E050 65C4 A621 9367 | |
To claim this, I am signing this object: |
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
const Immutable = require('immutable'); | |
const data = Immutable.Map({ | |
people: Immutable.List(['Joe', 'Ray', 'Nigel']), | |
test: 'Hello World' | |
}) | |
const data2 = data.updateIn(['people'], ((people) => { | |
return people.set(0, 'Russel'); | |
})); |
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' | |
const http = require('http'); | |
const PORT = 3000; | |
http.createServer(( request, response ) => { | |
console.log('request: ', request.url); | |
console.log('request: ', request.method); |
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' | |
const Rocket = require('./Rocket.js'); | |
module.exports = class Missle extends Rocket { | |
constructor( speed, year ) { | |
super('Mach 10', 'North Korea', year) | |
this._speed = speed; | |
} |
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 tres(){ | |
var foo = 4 | |
return 3; | |
} | |
var uno; | |
var dos; | |
const quatro; | |
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
var money = 55.50; | |
var coffeeCost = 8.50; | |
var drinkCoffee = (function(){ | |
var cupsDrunk = 0; | |
return function(){ | |
if( money >= coffeeCost ){ | |
money -= coffeeCost; | |
cupsDrunk++; | |
} |
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
module.exports = function(sequelize, DataTypes) { | |
var User = sequelize.define("User", { | |
username: DataTypes.STRING | |
}); | |
return User; | |
}; |
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
var recursify = function(num){ | |
//base case | |
if(num === 0){ | |
return; | |
} | |
console.log(num); | |
recursify(--num); | |
}; | |
recursify(10); // 10 9 8 7 6 5 4 3 2 1 |
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
var express = require('express'); | |
var app = express(); | |
// Passport's sole purpose is to authenticate requests, which it does through an extensible set of plugins known as strategies. Passport does not mount routes or assume any particular database schema, which maximizes flexibility and allows application-level decisions to be made by the developer. | |
var passport = require('passport'); | |
// This module lets you authenticate HTTP requests using the standard basic and digest schemes in your Node.js applications. | |
var BasicStrategy = require('passport-http').BasicStrategy; // Want to use Basic Authentication Strategy | |
// Other middleware |