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'; | |
module.exports = { | |
sum: (n1, n2) => { | |
return n1 + n2; | |
}, | |
sub: (n1, n2) => { | |
return n1 - n2; | |
}, |
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 Calc = require('./../Calc'); | |
const chai = require('chai'); | |
const expect = chai.expect; | |
describe('name of file - Calc', ( ) => { | |
it('description of the test - sum should return 4', (done) => { | |
let resultSum = Calc.sum( 2, 2 ); | |
expect( resultSum ).to.be.equal( 4 ); |
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 Calc = require('./../Calc'); | |
const chai = require('chai'); | |
const expect = chai.expect; | |
describe('name of file - Calc', ( ) => { | |
it('description of the test - sum should return 4', (done) => { | |
let resultSum = Calc.sum( 2, 2 ); | |
expect( resultSum ).to.be.equal( 4 ); |
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
➜ ~ git c | |
cat-file -- provide content or type information for repository objects | |
check-attr -- display gitattributes information | |
check-ref-format -- ensure that a reference name is well formed | |
checkout -- checkout branch or paths to working tree | |
checkout-index -- copy files from index to working directory | |
cherry -- find commits not merged upstream | |
cherry-pick -- apply changes introduced by some existing commits | |
citool -- graphical alternative to git commit | |
clean -- remove untracked files from working tree |
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
/* | |
Iterators | |
Um objeto é um iterator quando ele sabe como acessar os items de uma coleção um por vez enquanto mantém o endereço da posição | |
atual da sequencia. Em JavaScript um interator é um objeto que prové o método next() que retorna o próximo item da sequencia | |
esse método retorna um objeto com as sequintes propriedades: done e value. | |
*/ | |
function makeIterator(array){ | |
var nextIndex = 0; |
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
/* | |
Enquanto iterators personalizados são uma ferramenta muito útil, sua criação requer uma programação cuidadosa devido à | |
necessidade de manter explicitamente seu estado interno. Generators prove uma alternativa poderosa: ele permite definir um | |
algorítmo por meio da escrita de uma simples função que pode manter o seu próprio estado. | |
Um generator é um tipo especial de função que trabalha como uma fábrica para iterators. Uma função se torna um generator quando | |
contém um ou mais expressões construtoras e se usa a sintaxe ``function*`` | |
*/ | |
function* idMaker(){ |
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'; | |
/** | |
* @ngdoc directive | |
* @name myapp.directive:forceLowerCase | |
* @description | |
* # forceLowerCase | |
*/ | |
angular.module('myapp') | |
.directive('forceLowerCase', function ($parse) { |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/home/ronaiza/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
ZSH_THEME="bira" |
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 express = require('express') | |
const Analytics = require('./src/index') | |
const app = express() | |
const PORT = process.env.PORT || 8000 | |
app.get('/api', (req, res) => { | |
const username = req.param('username') |
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
/** | |
On your package.json just put `"npm start": "node server.js"` and deploy your application to heroku | |
**/ | |
'use strict' | |
const express = require('express') | |
const app = express() | |
const PORT = process.env.PORT || 8000 |
OlderNewer