A Pen by Ainu Jorge Chambeaud Helguera on CodePen.
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 a(){ | |
var promise = new Promise(function (resolve, reject) { | |
resolve(1); | |
}); | |
return promise; | |
} | |
function b(){ | |
return a().then(function () { | |
return Promise.resolve("11"); |
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
interface Person { | |
firstName: string; | |
lastName: string; | |
} | |
function greeter(person: Person) { | |
return "Hello, " + person.firstName + " " + person.lastName; | |
} | |
var user = { firstName: "Jane", lastName: "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
/* | |
* Simple async function: Dividir dos numeros. Falla si el deniminador es cero | |
*/ | |
function ioDivisionOpeation(x, y, callback) { | |
setTimeout( | |
() => { | |
if (y === 0) { | |
return callback(new Error('Division by cero')); | |
} |
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 simple que retorna una promise | |
function add(a, b) { | |
/** | |
* Alias para: | |
* | |
* return new Promise((resolve, reject) => resolve(a + b)); | |
*/ | |
return Promise.resolve(a + b); | |
} |
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
// Implementacion simple de un EventEmitter en node.js | |
class Emitter { | |
constructor() { | |
this.subscriptors = {}; | |
} | |
emit(event, data) { | |
this.subscriptors[event] && this.subscriptors[event].forEach(subscritor => subscritor(data)); | |
} |
Asegurate de tener node.js instalado, ya que varias tools dependen de node. Recomendamos instalar la version 6.11 (LTS)
que podes descargar de la pagina de node.
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
/* | |
* Write a program that prints the numbers from 1 to 100. | |
* But for multiples of three print “Fizz” instead of the number | |
* and for the multiples of five print “Buzz”. | |
* For numbers which are multiples of both three and five print “FizzBuzz” | |
*/ | |
const range = (init, end) => { | |
const nums = []; |
By Tyler Mcginnis at https://tylermcginnis.com/courses/
You should have the following completed on your computer before the workshop:
- Install the AWS CLI.
- Have Node.js installed on your system. (Recommended: Use nvm.)
- Install
yarn
withbrew install yarn
.
- Install
- Create an AWS account. (This will require a valid credit card.)
- Create a Travis CI account. (This should be as simple as logging in via GitHub).
OlderNewer