This file contains 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
alias yi='yarn install' | |
alias ya='yarn add $@' | |
alias yad='yarn add -D $@' | |
alias cai='rm -rf node_modules && yarn install' | |
alias rnra='react-native run-android' | |
alias rnri='react-native run-ios' | |
alias docp='docker container prune -f' | |
alias dosp='docker system prune --all' |
This file contains 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 abrevia(str) { | |
const nome = str.replace(/\s+/gi, ' ') | |
.trim(); | |
return nome.split(' ') | |
.map((parte, index, nomes) => (index == (nomes.length - 1)) ? parte : `${parte[0]}.`) | |
.join(' '); | |
} |
This file contains 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
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import axios from 'axios'; | |
class App extends Component { | |
onInputChange = ({ target }) => { | |
const { files } = target; |
This file contains 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
const { reduce } = require('lodash'); | |
const replaceMap = { | |
'a': '[àáâãäå]', | |
'b': '[ß]', | |
'c': '[ç]', | |
'e': '[èéêë]', | |
'i': '[ìíîï]', | |
'o': '[ðñòóôõöø]', | |
's': '[$]', |
This file contains 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
<?php | |
// Test cards | |
$cards = array( | |
'378282246310005', // American Express | |
'371449635398431', // American Express | |
'5078601870000127985', // Aura | |
'5078601800003247449', // Aura | |
'30569309025904', // Diners Club | |
'38520000023237', // Diners Club |
This file contains 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
<?php | |
require_once "src/Sys/Sessao.php"; | |
use Sys\Sessao; | |
$sessao = new Sessao(); | |
if ($sessao->existe('usuario_logado')) { | |
$usuario = $sessao->ler('usuario_logado'); |
This file contains 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
<?php | |
require_once "src/Sys/Conexao.php"; | |
require_once "src/Sys/Sessao.php"; | |
require_once "src/Sys/Usuario.php"; | |
require_once "src/Sys/ValidacaoException.php"; | |
use Sys\Conexao; | |
use Sys\Sessao; | |
use Sys\Usuario; |
This file contains 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
<?php | |
namespace Sys; | |
class Usuario | |
{ | |
const ATIVO = 1; | |
const INVATIVO = 0; | |
/** |
This file contains 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
<?php | |
namespace Sys; | |
class ValidacaoException extends \Exception {} |
This file contains 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
<?php | |
namespace Sys; | |
class Sessao | |
{ | |
public function __construct() { | |
if (!isset($_SESSION)) | |
session_start(); |