Skip to content

Instantly share code, notes, and snippets.

View dvbeato's full-sized avatar

Diogo Beato dvbeato

  • Nubank
  • São Paulo
View GitHub Profile
@dvbeato
dvbeato / factory_exemple.java
Created March 16, 2016 13:54
Test Factory Example
DuplicataCobrancaFactory
.comAbatimento()
.quitadaComDinheiro()
.build(); // cria o objeto
DuplicataCobrancaFactory
.comAbatimento()
.quitadaComDinheiro()
.buildList(10); //cria 10 itens do objeto
:ismael::ismael::ismael: :ismael::ismael::ismael: :ismael::ismael: :ismael::ismael: :ismael::ismael::ismael: :ismael::ismael::ismael: :ismael:
:ismael: :ismael: :ismael: :ismael::ismael: :ismael: :ismael: :ismael: :ismael: :ismael:
:ismael: :ismael::ismael::ismael: :ismael: :ismael: :ismael: :ismael::ismael::ismael: :ismael::ismael: :ismael:
:ismael: :ismael: :ismael: :ismael: :ismael: :ismael: :ismael: :ismael: :ismael:
:ismael::ismael::ismael: :ismael::ismael::ismael: :ismael: :ismael: :ismael: :ismael: :ismael::ismael::ismael: :ismael::ismael::ismael:
object CaixaEletronico {
def main(args: Array[String]) {
val valorSaque = args(0).toInt
val notas = List(100,50,20,10)
def quantidade(notas:List[Int], valorSaque:Int): List[Int] = notas match {
case Nil => List()
case valorNota::notas => {
List(valorSaque / valorNota) ++ quantidade(notas, valorSaque - valorNota * (valorSaque / valorNota))
}
@ResponseBody
@RequestMapping
public ResponseEntity loadData(Integer diretorioKey) {
Map<String, Object> data = Maps.newHashMap();
data.put("diretorios", diretorioService.list());
data.put("arquivos", diretorioService.listarArquivosPor(diretorioKey));
return new ResponseEntity<>(data, HttpStatus.OK);
}
function DriveController($scope, DiretorioService) {
//TODO: Controller Magics
DiretorioService.listarDiretorios()
.then( function(diretorios) {
$scope.diretorios = diretorios;
selecionarDiretorio(diretorios[0]);
guess :: Int -> [Char]
guess 7 = "Acertou"
guess x = "Ooops, tente outra vez."
plus1 :: [Int] -> [Int]
plus1 [] = []
plus1 (x:xs) = x + 1 : plus1 xs
find -E . -regex '.*\.(css|html|jsp|xml|js)' -exec sh -c 'iconv -f ISO-8859-1 -t UTF-8 {} > {}.utf8' \; -exec mv "{}".utf8 "{}" \;
@dvbeato
dvbeato / .bash_profile
Created December 30, 2014 11:50
bash_profile
# PS1="\n\e[0;36m[\u@\h \A]\e[m:\W\e[0;36m\$ \e[m"
# folders
export DEVELOPMENT=$HOME/Development
export ENVIROMENT=$DEVELOPMENT/env
export PROJECTS=$DEVELOPMENT/projects
export LABS=$DEVELOPMENT/labs
# varenvs
@dvbeato
dvbeato / karma.conf.js
Last active August 29, 2015 14:08
Simple Karma Conf File
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use

#BrazilJS 2014

Talks: Slides & Links

Day Talk Speaker Links
1 Why ServiceWorker may be the next big thing Renato Mangini Slides
1 Frontend at Scale - The Tumblr Story Chris Miller Slides
1 Intro to GFX: Raw WebGL Nick Desaulniers Slides