Skip to content

Instantly share code, notes, and snippets.

View VitorLuizC's full-sized avatar

Vitor L Cavalcanti VitorLuizC

View GitHub Profile
@VitorLuizC
VitorLuizC / README.md
Last active October 20, 2017 00:41
Sistemas Distribuídos

Sizing (Dimensionamento) & Capacity Planning

O que significa?

  • Expectativa de dimensionamento dos dados;
    Ex. Quantidade de usuários com acesso a uma plataforma, sazonalidades, expectativa de crescimento deles;

O que define?

  • Definir as máquinas e arquitetura de software.
@VitorLuizC
VitorLuizC / README.md
Last active October 21, 2017 02:47
Inadimplência

Inadimplência

A forma ideal de lidar com o problema é previnir a inadimplência.

  • Análise de crédito com mais qualidade;
    Conhecer meu cliente, criar estatísticas.
    • Entrevista mais completa;
    • Cadastros atualizados;
  • Bases de históricos completas;
@VitorLuizC
VitorLuizC / 0. shortlyWatchers.js
Last active November 6, 2017 16:30
Shortly Vue
import compose from './compose'
export default (watchers, method) => {
const shorlty = compose(watchers,
(_, watcher) => ({
[watcher]: typeof method !== 'string' ? method : function () {
this[method](...arguments)
}
})
)
@VitorLuizC
VitorLuizC / README.md
Last active November 8, 2017 01:09
Revisão do ENADE

Revisão do ENADE

1. Aula

Professor Gustavo

Na teoria de conjuntos, as premisas de uma partição são:

  • Não pode ter sub-conjuntos vazios;
  • Todos os elementos de um conjunto precisam estar contidos nos sub-conjuntos;
  • A junção da sub-conjuntos resulta no conjuntos
@VitorLuizC
VitorLuizC / README.md
Last active April 14, 2019 03:08
Operadores e "hacks"

&&

const response = await fetch('https://app.io/user/187927981')
// { data: { user: { name: 'Vitor' } } }

const name = response && response.data && response.data.user && response.data.user.name
// 'Vitor'
@VitorLuizC
VitorLuizC / Toggle.js
Created November 23, 2017 18:18
Simply toggle A to B and B to A.
/**
* A => B | B => A
* @param {(A|B)} value
* @param {A} a
* @param {B} b
* @template A, B
* @returns {(A|B)}
*/
const Toggle = (a = true, b = false) => value => value === a ? b : a
import { cull } from 'cullender';
import { isActive, isLatest } from './validators'
// ...
const latest = cull(
[ ...users ],
isActive,
isLatest
);
@VitorLuizC
VitorLuizC / cast.js
Last active December 13, 2017 15:01
/**
* Cast object in a FormData.
* @param {object} object
* @returns {FormData}
*/
export const toFormData = (object) => {
const entries = Object.entries(object)
const form = entries.reduce((form, [ name, value ]) => {
form.append(name, value)
return form
@VitorLuizC
VitorLuizC / collection.js
Last active December 18, 2017 03:41
Using composition on a Store
export const unique = (values) => [ ...new Set(values) ]
export const add = (value, position = 'first') => (values) => {
return position === 'first'
? [ value, ...values ]
: [ ...values, value ]
}
@VitorLuizC
VitorLuizC / event.ts
Last active January 14, 2018 12:50
A silly store library. Create a state and it's actions, whatch and handle it's changes.
type CustomEventHandler = (event: any) => void;
type CustomEvent = {
name: string,
handler: CustomEventHandler
};
export default function Event (object) {
const event = {
list: [],