Skip to content

Instantly share code, notes, and snippets.

View VitorLuizC's full-sized avatar

Vitor L Cavalcanti VitorLuizC

View GitHub Profile
@VitorLuizC
VitorLuizC / style.css
Created March 13, 2018 17:49
Pretty NPM Profile
:root {
--package-gutter: 8px;
--package-border-size: 1px;
--package-border: var(--package-border-size) solid rgba(0,0,0, .15);
--name-size: 200px;
--version-size: 64px;
--version-gutter: 5px;
}
.collaborated-packages {

FDD - Feature Driven Developmnent

+ src/
|
+ - + components/
    |
    + - + companies/
    |   |
 | + - + CompaniesTable.vue
position(
$position,
$top = null,
$right = $top,
$bottom = $top,
$left = $right
)
position: $position
top: $top
right: $right
type ClassNameObject = { [key: string]: boolean };
type ClassNameList = Array<(string | ClassNameObject)>;
type ClassNameArguments = (string | ClassNameObject | ClassNameList);
type ClassNameEntry = [keyof ClassNameObject, ClassNameObject[keyof ClassNameObject]];
const isTruthyEntryValue = ([ , value ]: ClassNameEntry) => Boolean(value);
const Implementation = { ... } || ( ... ) => { ... };
/**
* Fix some buggy module interoperability strategies.
* @example ```js
* const ModuleName = require('module-name');
* // Or
* const { default: ModuleName } = require('module-name');
* ```
* @param target
import reconstruct, { PropertyName } from 'reconstruct-descriptors';
/**
* Check if object property is a method.
*/
function isMethod (name: PropertyName, value: any) {
return (
typeof value === 'function' &&
typeof name !== 'symbol' &&
name !== 'constructor'
const reconstruct = (object) => {
const descriptors = Object.getOwnPropertyDescriptors(object);
const entries = Object.entries(descriptors);
const properties = entries.reduce((properties, [ property, descriptor ]) => ({
...properties,
...h(property, descriptor)
}), {});
return Object.create({}, properties);
@VitorLuizC
VitorLuizC / Home.vue
Last active June 5, 2024 14:58
Exemplo de Autenticação com JWT em Vue.js
<template>
<h1>Página secreta!</h1>
</template>

A biblioteca consiste num mapa de valor e ouvintes.

type Handler = (payload: any) => void;

type Listeners = Map<string, Array<Handler>>;

type Emitters = WeakMap<any, Listeners>;
import React, { PureComponent } from 'react';
import { getPersisted, FormContainer, FormInput } from 'react-persistent-form';
class SignInForm extends PureComponent {
state = {
email: getPersisted('SignInForm.email') || '',
password: getPersisted('SignInForm.password') || '',
};
signIn () {