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
//TODO: Validar os operadores necessários para diminuir o tamanho | |
import 'rxjs/Rx'; | |
import {App, Platform} from 'ionic-angular'; | |
import {StatusBar} from 'ionic-native'; | |
import {LoginPage} from './pages/login/login'; | |
import {HttpClient} from "./common/providers/http"; |
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
<!DOCTYPE html> | |
<html ng-app="myApp"> | |
<head> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.2/angular.min.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/danialfarid-angular-file-upload/12.0.4/ng-file-upload-all.js"></script> | |
</head> | |
<body> | |
<h1>S3 Direct Upload</h1> |
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
'use strict'; | |
/* | |
* Importa as dependências necessárias | |
*/ | |
let express = require('express'), | |
http = require('http'), | |
path = require('path'), | |
aws = require('aws-sdk'); |
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
/** | |
* Formats a URI using a context and a given RexExp | |
* The default format is {value[0:20]} and the [0:2] is optional and represent a value.slice(0,2) | |
* @param {string} URI The URI to be replace | |
* @param {object} context The given context to work the lookup. e.g: {value: 'MY VALUE TO REPLACE'} | |
* @param {RegExp} The regex to find the ocurrences on the URI | |
*/ | |
function formatCustomURI(URI, context, reg) { | |
URI = URI || '[0:2]\n\n{val[0:2]} \n{valor[0:2]}\n\nlucas\n${}\n$[]'; |
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
// Criação de string literal básica (Basic literal string creation) | |
// Reparem que não é apóstofre (aspas simples) ou aspas, mas o ascento grave (`) | |
`This is a pretty little template string.` | |
// String de linhas múltiplas (Multiline strings) | |
`In ES5 this is | |
not legal.` | |
// Interpolação de variáveis (Interpolate variable bindings) | |
// Muito parecido com string.format do python |
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
function f(x, y, z) { | |
// x === 1, y === 2, z === 3 | |
return x + y + z; | |
} | |
// Passa cada elemento do vetor como um argumento | |
f(...[1,2,3]) == 6 |
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
function f(x, ...y) { | |
// y é um vetor. y[0] === 'hello', y[1] === true | |
return x * y.length; | |
} | |
f(3, "hello", true) == 6 |
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
function f() { | |
{ | |
let x; | |
{ | |
// ok, declarado no escopo | |
const x = "sneaky"; | |
// erro, o valor é uma constante | |
x = "foo"; | |
} | |
// ok, declarado com `let` no escopo atual (linha 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
function f(x, y=12) { | |
// y é 12 se não passado (ou passado como undefined) | |
return x + y; | |
} | |
f(3) == 15 |
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
// Declaração da classe | |
class Funcionario extends Pessoa { | |
// Método construtor | |
constructor(cargo) { | |
// Chama o construtor da classe Pessoa | |
super(cargo); | |
this.foo = 'foo'; |