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
kelvearagao / dateEn.js
Created January 6, 2016 18:15
Função javascript para converter a data do formato brasileiro para formato inglês.
* Recebe um data no formato dd/mm/yyyy e retorna yyyy-mm-dd.
* @param string date - Data no formato 'dd/mm/yyyy'.
* @return string - Data no formato 'yyyy-mm-dd'.
function dateToEN(date)
return date.split('/').reverse().join('-');
kelvearagao / index.html
Created October 13, 2017 14:44
Select2: Infinite Scroll with Local Array Data
<!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">


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
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
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()))
# 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!
<!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
server {
listen 8585;
root "C:/Users/kelve/workspace/doacoes-sustentacao-2017/app/webroot";
index index.php;
location "/" {
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
C:\Users\username>netstat -o -n -a | findstr 0.0:3000
C:\Users\username>taskkill /F /PID 3116