Skip to content

Instantly share code, notes, and snippets.

CHEAT SHEET MORE USED

Git

git clone url - clonar a branch para o pc

git checkout nome_branch - entrar numa branch já existente.

git checkout -b name_branch - criar e entrar na branch.

git fetch - sincroniza branchs remotas criadas.

// posicionamento
- zz: centro
- zt(op): cima
- zb(ottom): baixo
// teclas de inserção
- i: antes do cursor
- I: início da linha
- o: linha de baixo
- O: linha de cima
@allenwyma
allenwyma / install_elixir.md
Last active December 15, 2020 15:23 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

const then = Function.call.bind(Promise.prototype.then);
export default (...λs) => (value) => λs.reduce(then, Promise.resolve(value));
@VitorLuizC
VitorLuizC / README.md
Last active October 9, 2018 16:49
Configurações do `package.json` para diferentes formatos de pacotes.

Configurações do package.json para a saída do pacote

Saídas do pacote

Configuração Arquivo exportado
main Saída padrão do pacote, no formato CommonJS para atender ferramentas de empacotamento e o ambiente padrão do Node.js.
module Saída do pacote no formato ES2015 para ferramentas de empacotamento e ambientes que dão suporte a este formato.
cdn Saída do pacote no formato UMD/IIFE para CDNs e outras ferramentas hospedarem o módulo para browsers e outros consumidores.
unpkg O mesmo da cdn, porém para a resolução do unpkg.
@prodrammer
prodrammer / cypress-plugins-index.js
Last active April 7, 2021 18:41
Configure cypress.io using dotenv-extended, and getenv
// ***********************************************************
// https://on.cypress.io/plugins-guide
// ***********************************************************
const dotenv = require('dotenv-extended')
const getenv = require('getenv')
dotenv.load()
const overrideBaseUrl = () => {
let baseUrl = getenv.string('CYPRESS_BASE_URL', '')
import lazyLoadingRoutes from '../../support/lazyLoadingRoutes'
export default lazyLoadingRoutes([
{ path: '/login', component: 'Login', meta: { requiresAuth: false } },
{ path: '/forgotPassword', component: 'ForgotPassword', meta: { requiresAuth: false } },
{ path: '/forgotEmail', component: 'ForgotEmail', meta: { requiresAuth: false } },
{ path: '/createAccount', component: 'CreateAccount', meta: { requiresAuth: false } }
])
type Dictionary = {
[name: string]: string;
};
type Getter = {
get: () => any;
set: (value: any) => void;
};
type Getters <T extends Dictionary> = {
@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'