Skip to content

Instantly share code, notes, and snippets.

View luizpericolo's full-sized avatar

Luiz Felipe da Costa Pericolo Barbosa luizpericolo

  • Rio de Janeiro/RJ, Brazil
View GitHub Profile
@luizpericolo
luizpericolo / processing.py
Created January 8, 2020 14:00
Processing drizzle translated into python
# original source: https://github.com/ian-bateman/generative_art/tree/master/drizzle
import random
import sys
DROPLETS = []
N_DROPLETS = 4000
BLUE_COUNT = None
BLUE_UP = None
@luizpericolo
luizpericolo / py_pro_ramalho.md
Created August 1, 2016 13:59
Aprendizados da aula ministrada por Luciano Ramalho

Things I learned today

Defensive coding

  • Copy lists passed as parameters to class so that the this that was passed is not changed. People rarely expect this. (1)
  • Ensure parameter passed is an iterable. Fails fast. (2)

Example:

def doSth() = {
val futureResponse = goToES() // tipo aqui é Future[Map[Int, Int]]
val filters = futureResponse.map { response =>
response.keys.map { key =>
(key, key.upper(), key.lower())
}
}
// O tipo de filters é Future[List(String, String, String)]
https://www.hotelurbano.com/hoteis/saquarema/pousada-pratagy-682/03-06-2016/05-06-2016/1/2/0?o=63467
https://www.hotelurbano.com/hoteis/curitiba/caravelle-palace-hotel-1591/03-06-2016/05-06-2016/1/2/0?o=68119
https://www.hotelurbano.com/hoteis/sao-lourenco/hotel-londres-5263/03-06-2016/05-06-2016/1/2/0?o=86927
https://www.hotelurbano.com/hoteis/paraty/pousada-aurora-3352/03-06-2016/05-06-2016/1/2/0?o=70883
https://www.hotelurbano.com/hoteis/sao-lourenco/hotel-metropole-5261/03-06-2016/05-06-2016/1/2/0?o=86904
https://www.hotelurbano.com/hoteis/armacao-dos-buzios/htl-terra-mar-buzios-7158/03-06-2016/05-06-2016/1/2/0?o=98274
https://www.hotelurbano.com/hoteis/penedo/city-park-hotel-237/03-06-2016/05-06-2016/1/2/0?o=61381
https://www.hotelurbano.com/hoteis/paraty/pousada-canoeiro-paraty-6848/03-06-2016/05-06-2016/1/2/0?o=96905
https://www.hotelurbano.com/hoteis/teresopolis/hotel-alpina-172/03-06-2016/05-06-2016/1/2/0?o=61228
https://www.hotelurbano.com/hoteis/sao-lourenco/hotel-regencia-612/03-06-2016/05-06-2016