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
palpites.find({user_id:'1234'}).limit(5).ski(page * 5).exec(function(err, results) { | |
results = results.map(function(palpite){ | |
var confrontos = palpite.confrontos.map((item){ return item.confronto_id }) | |
return new Promise(function(resolve){ | |
confronto.find({_id: {$in: confrontos} }).exec(function(err, confrontos){ | |
palpite.confrontos = confrontos; | |
resolve(palpite) | |
}) | |
}) | |
}) |
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
import React, { Component } from 'react' | |
import { Flatlist, View, Dimensions } from 'react-native' | |
let {width, height} = Dimensions.get('window') | |
export default class Grid extends Component { | |
construtor(props) | |
super(props) | |
this.state = { | |
grid: 3 | |
} |
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
import React, { Component } from 'react' | |
import { ScrollView, Dimensions } from 'react-native'; | |
let { width, heigth } = Dimensions.get('window'); | |
export default class HomeScreen extends Component { | |
constructor(props){ | |
super(props) | |
this.state = { | |
users: [], | |
page: 0 |
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 Knox = knox.createClient({ | |
key: 'key da aws', | |
secret: 'secret da aws', | |
bucket: 'pasta criada' | |
}); | |
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 MyComponent = React.createClass({ | |
render: function() { | |
if (this.props.first) { | |
return <div className="first"><span>A Span</span></div>; | |
} else { | |
return <div className="second"><p>A Paragraph</p></div>; | |
} | |
} | |
}); |
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
require('getmodule'); | |
//com getmodule | |
var controller = getmodule('app/controllers/index'); | |
//sem getmodule | |
var controller = require('../../app/controllers/index'); |
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 compare = function(choice1,choice2){ | |
if (choice1 === choice2){ | |
return "The result is a tie!"; | |
} | |
else if(choice1 === "rock") { | |
if(choice2 === "scissors") { | |
return"rock wins"; | |
} | |
else { | |
return "paper wins"; |
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
WOOOOOOOOOW | |
FUNCIONOU SAPORRA O/ |
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 form = require('formidable'); | |
exports.upload = function(req, res){ | |
var form = new formidable.IncomingForm(); | |
/* | |
Só habilite o multiples, caso você queira fazer upload de várias imagens ao mesmo tempo. | |
Se não habilitar isso, ele tem o valor FALSE por padrão. | |
*/ | |
form.multiples = true; | |
/* |
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
Criar uma aplicação com Angular 1.x, que se comunique com a API do github. | |
A estrutura tem que se basear no modelo MVC, no uso de rotas para acessar subniveis, exemplo: | |
Usuario | |
-> repositorios | |
-> perfil do repositório | |
-> organizações | |
Requisitos: |