#Manipulação de datas
#Programação funcional
| /* | |
| * Adds a team to all the repos in a Github organization. This is a tedious | |
| * process in the UI. You'll need a newer version of node to run this (e.g 9+) | |
| * because it uses async/await. | |
| * | |
| * Instructions: | |
| * | |
| * 1. Copy this file somewhere on your computer, e.g. ~/addteamrepos.js | |
| * 2. Fill in the uppercase variables below with the right values | |
| * 3. Run this file: `$ node ~/addteamrepos.js` |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "syscall" | |
| ) | |
| func main() { |
| set nocompatible " be iMproved, required | |
| filetype off " required | |
| set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab | |
| " set the runtime path to include Vundle and initialize | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| " alternatively, pass a path where Vundle should install plugins | |
| "call vundle#begin('~/some/path/here') |
| /* ES5 */ | |
| var adder = function(x){ | |
| return function(y){ | |
| return x+y; | |
| }; | |
| } | |
| adder(5)(5) | |
| // 10 | |
| var filmes = [ | |
| { name: 'Matrix', genero: 'acao'} | |
| ,{ name: 'Mad Max', genero: 'acao'} | |
| ,{ name: 'Interestelar', genero: 'ficcao cientifica'} | |
| ,{ name: 'A origem', genero: 'ficcao cientifica'} | |
| ,{ name: 'Seven', genero: 'policial'} | |
| ]; | |
| var hasGenero = function(genero){ | |
| return function(obj){ |
| // IIFE - Immediately Invoked Function Expression | |
| // Serve para criar um contexto de execução e proteger as Variaveis / Funcoes / Obj e nao deixar elas em contexto global. | |
| ;(function(global, $) { | |
| // 'new' gera um objeto vazio. | |
| // Esse é o metodo construtor, que chama outro metodo o: init e retorna o objeto. | |
| var PluginName = function(variable1, variable2) { | |
| // Isso faz com que o plugin possa ser usado sem precisar ficar dando new | |
| return new PluginName.init(variable1, variable2); | |
| } |
#Manipulação de datas
#Programação funcional