This file contains hidden or 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 a = { | |
sayHello(){ | |
console.log("hello") | |
} | |
} | |
var b = { | |
sayHello: function(){ | |
console.log("hello") | |
} |
This file contains hidden or 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
// Before ECMAScript 2015 | |
const obj = { | |
foo: function() { | |
// ... | |
}, | |
bar: function() { | |
// ... | |
} | |
} |
This file contains hidden or 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
/** Taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions*/ | |
function Person() { | |
// The Person() constructor defines `this` as an instance of itself. | |
this.age = 0; | |
setInterval(function growUp() { | |
// In non-strict mode, the growUp() function defines `this` | |
// as the global object (because it's where growUp() is executed.), | |
// which is different from the `this` |
This file contains hidden or 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
export class MyClass { | |
constructor(private myVariable: string) {} | |
getMyVariable() { | |
return this.myVariable; | |
} | |
} |
This file contains hidden or 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
export class MyClass { | |
static add(num1, num2) { | |
return num1 + num2; | |
} | |
subtract(num1, num2) { | |
return num1 - num2; | |
} | |
} |
This file contains hidden or 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
/* Stack the shows the progression of the LIFO thinking */ | |
console.clear() | |
const array = []; | |
console.log("Initial array ",array) | |
console.log("Push 1: ", array.push(1)) | |
console.log("Push 2: ", array.push(2)) | |
console.log("Push 3: ", array.push(3)) | |
console.log("Array ", array) | |
console.log("Pop 1: ", array.pop()) |
This file contains hidden or 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 observable = events => { | |
const INTERVAL = 1 * 1000; | |
let schedulerId; | |
return { | |
subscribe: observer => { | |
schedulerId = setInterval(() => { | |
if(events.length === 0) { | |
observer.complete(); | |
clearInterval(schedulerId); |
This file contains hidden or 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
mongo: | |
image: mongo:latest | |
container_name: mongoAWS | |
hostname: mongodbAWS | |
volumes: | |
- ./.docker/mongodb/mongod.conf:/etc/mongod.conf | |
- ./.docker/mongodb/initdb.d/:/docker-entrypoint-initdb.d/ | |
- ./.docker/mongodb/data/db/:/data/db/ | |
- ./.docker/mongodb/data/log/:/var/log/mongodb/ | |
env_file: |
This file contains hidden or 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
version: [docker_compose_version] | |
services: | |
contractor-web-app: | |
image: "[username]/[dockerhub_image_name]" | |
ports: | |
- "[host_port]:[container_port]" | |
env_file: | |
- [path_to_.env_file] |