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
npm i --save-dev babel-cli babel-preset-env nodemon && echo { "presets": ["env"] } > .babelrc |
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 str = "isso é uma string"; | |
typeof(str);//'string' | |
var num = 1.74; | |
typeof(num);//'number' | |
var bol = true; | |
typeof(bol);//'boolean' | |
var und; //undefined |
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 str = "isso é uma string"; | |
typeof(str);//'string' | |
var num = 1.74; | |
typeof(num);//'number' | |
var bol = true; | |
typeof(bol);//'boolean' | |
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
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
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 soma = (x, y) => x + y; | |
const calcular = (fn, x, y) => fn(x, y); | |
calcular(sum, 1, 2); |
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
npm install --save-dev babel-cli babel-preset-es2017 && echo '{ "presets": ["es2017"] }' > .babelrc && echo 'function a(b,) { console.log("hi"); }; a()' > index.js | |
//run ./node_modules/.bin/babel-node index.js | |
//params $babel$ $script.js$ --presets es2017 |
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
/** | |
* Created in 21/06/2017. | |
* Author: William Dias Vargas | |
* Github: @wdiasvargas | |
*/ | |
'use strict'; | |
import yCombFact from './y-combinator-factorial' | |
export default (number) => ((fn) => fn(fn, number))((f, n) => (n <= 1)? 1: n * f(f, (n - 1))) | |
console.info(yCombFact(5)) |
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
/** | |
* Created in 21/06/2017. | |
* Author: William Dias Vargas | |
* Github: @wdiasvargas | |
*/ | |
'use strict'; | |
//http://kestas.kuliukas.com/YCombinatorExplained/ | |
() => (f) => f(f)((f) =>((x) => (f(f))(x)))) | |
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
/** | |
* Created in 20/06/2017. | |
* Author: William Dias Vargas | |
* Github: @wdiasvargas | |
*/ | |
"use strict"; | |
export default (fn, cache = {}) => (x) => (x in cache) ? cache[x] : cache[x] = fn(x); |
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
/** | |
* Created in 20/06/2017. | |
* Author: William Dias Vargas | |
* Github: @wdiasvargas | |
*/ | |
"use strict"; | |
export default (fn, cache = {}) => (x) => (x in cache) ? cache[x] : cache[x] = fn(x); |