Skip to content

Instantly share code, notes, and snippets.

#alias git
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit -m '
alias gd='git diff '
alias go='git checkout '
alias ..='cd ..'
@brunobc
brunobc / arrayzing.md
Last active October 1, 2018 11:33 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet

Criação da chave de segurança

ssh-keygen -t rsa -C "seu_email@provedor.com"

Inicializa um projeto git

git init

Verificar o estado dos arquivos

@brunobc
brunobc / NPMWithoutSudo.md
Created January 19, 2016 04:33
Install `npm` packages globally without sudo on OS X and Linux

Install npm packages globally without sudo on OS X and Linux

npm installs packages locally within your projects by default. You can also install packages globally (e.g. npm install -g <package>) (useful for command-line apps). However the downside of this is that you need to be root (or use sudo) to be able to install globally.

Here is a way to install packages globally for a given user.

1. Create a directory for globally packages
mkdir "${HOME}/.npm-packages"

Regex

Expressão regulares são padrões utilizados para identificar determinadas combinações ou cadeias de caracteres em uma string.

Regex Engine

alt tag

String usada na busca: target

@brunobc
brunobc / restingSpreading.md
Created March 20, 2019 03:09
Resting and Spreading JavaScript Objects

Adicionar Propriedades

Clonar um objeto ao mesmo tempo em que adiciona propriedades adicionais ao objeto clonado. No exemplo abaixo user é clonado e password é adicinado em userWithPass.

const user = { id: 100, name: 'Howard Moon'}
const userWithPass = { ...user, password: 'Password!' }

user //=> { id: 100, name: 'Howard Moon' }
userWithPass //=> { id: 100, name: 'Howard Moon', password: 'Password!' }
{
// Define o tema do VSCode
"workbench.colorTheme": "Dracula",
// Configura tamanho e família da fonte
"editor.fontSize": 18,
"editor.lineHeight": 24,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
@brunobc
brunobc / Promise.md
Last active October 28, 2019 12:50
Promise all -> reflect

Função de reflexão

function reflect (promise) {
  return promise
    .then((valor) => ({ status: 'fulfilled', value: valor }))
  	.catch((razao) => ({ status: 'rejected', reason: razao }))
}

Exemplo

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export ANDROID_HOME=~/Android/Sdk
export PATH="$PATH:$ANDROID_HOME/tools"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
# Path to your oh-my-zsh installation.
export ZSH="/Users/brunobc/.oh-my-zsh"
export PATH="$PATH:/usr/local/bin"