Skip to content

Instantly share code, notes, and snippets.

View kelvearagao's full-sized avatar

Kelve Aragão kelvearagao

  • XP Inc
  • São Paulo - SP
View GitHub Profile


I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).


Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
kelvearagao / copyToClipboard.js
Created November 13, 2020 19:27
receives data as an argument and copies it to the clipboard
View copyToClipboard.js
const copyToClipboard = data => {
const el = document.createElement('textarea');
el.value = data;
el.setAttribute('readonly', ''); = 'absolute'; = '-9999px';
kelvearagao / debounce.js
Created January 28, 2020 12:43
RxJs: redux-observable and buffer debounce
View debounce.js
export const startWsEpic = action$ => action$.pipe(
mergeMap(action => {
const source$ = ws(action.payload).pipe(share())
return source$.pipe(
map(data => updateData(data)),
catchError(() => of(updateDataError()))
View heroku useful commands
# git subtree push --prefix server heroku heroku-master
# heroku logs --tail
# heroku restart -a server-gq
kelvearagao / javascript-file-download.html
Created September 8, 2018 03:54
Realizando download via javascript!
View javascript-file-download.html
<!DOCTYPE html>
<title>testing download</title>
<h1>testing download</h1>
<button onclick="fetch('GET', '', true)">new version</button>
kelvearagao / nginx-vh.conf
Created November 11, 2017 16:17
EasyPHP + Nginx + CakePHP + Virtual Host
View nginx-vh.conf
server {
listen 8585;
root "C:/Users/kelve/workspace/doacoes-sustentacao-2017/app/webroot";
index index.php;
location "/" {
kelvearagao / index.html
Created October 13, 2017 14:44
Select2: Infinite Scroll with Local Array Data
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="select2.css" rel="stylesheet">
kelvearagao /
Created June 21, 2017 00:21
Comandos para resolução de conflitos com git
# prevalecer a versão do branch atual
$ git checkout --ours <path do arquivo>
# prevalecer a versão do outro branch
$ git checkout --theirs <path do arquivo>
# voltar pra versão inicial do conflito
$ git checkout -m <path do arquivo>
kelvearagao / gist:b454ebed7466a8edbb19ad439d04f234
Created December 9, 2016 18:17
Fechar processo no windows pesquisando a porta
View gist:b454ebed7466a8edbb19ad439d04f234
C:\Users\username>netstat -o -n -a | findstr 0.0:3000
C:\Users\username>taskkill /F /PID 3116
kelvearagao / dbdesign
Created June 24, 2016 12:17
db design link
View dbdesign