Skip to content

Instantly share code, notes, and snippets.

View woliveiras's full-sized avatar
🤖
Always typing code

William Oliveira woliveiras

🤖
Always typing code
View GitHub Profile
# Simple flask app sample
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return '<h1>Hello, pyenv!</h1>'
@woliveiras
woliveiras / sample.md
Last active August 1, 2017 02:28
Exemplo de Gist para Code Review

Code Review

Este arquivo possui um erro e você pode enviar uma sugestão de como resolver através do processo de code review, seja comentando na linha de código ou enviando uma mensagem logo abaixo do Gist.

Você consegue identificar o que está errado?

-pode ter a ver com o uso de listas no Gist *ou não

  • eu nem sei mais
  • faz tanto tempo que estou nessa tarefa
const animal = 'dog';
const animalName = 'Titio';
console.log(`I had a ${animal} named ${animalName}`); // “I had a dog named Titio.”
var animal = 'dog';
var animalName = 'Titio';
console.log('I had a ' + animal + ' named ' + animalName + '.'); // “I had a dog named Titio.”
function printAfterTimeout(string, timeout){
return new Promise((resolve, reject) => {
setTimeout(function(){
resolve(string);
}, timeout);
});
}
printAfterTimeout('Hello ', 2e3).then((result) => {
console.log(result);
class Car {
constructor(model) {
this.model = model;
this.color = null;
}
set model(model) {
this.model = model
}
brasilia // > Car {model: “Brasilia”, color: null}
// Utilizando o setter
brasilia.color = "Amarela" // “Amarela”
brasilia // > Car {model: “Brasilia”, color: “Amarela”}
// Utiliando o getter
brasilia.color // "Amarela"
function* generatorWithEnd() {
yield 1;
yield 2;
yield 3;
yield 4;
yield 5;
}
let myIterator = generatorWithEnd();
myIterator.next().value // 2
myIterator.next().value // 3
myIterator.next().value // 4
myIterator.next().value // 5
myIterator.next().value // 6
myIterator.next().value // 7
myIterator.next().value // 8
myIterator.next().value // 9
myIterator.next().value // 10
myIterator.next()
/*
Object
done: false
value: 0
> __proto__: Object
*/