Skip to content

Instantly share code, notes, and snippets.

View malbernaz's full-sized avatar

Miguel Albernaz malbernaz

  • Rio de Janeiro - RJ
View GitHub Profile
function flatten(array) {
return array.reduce(
(a, b) => a.concat(b instanceof Array ? flatten(b) : b),
[]
);
}
@malbernaz
malbernaz / .vimrc
Created December 14, 2018 17:16
.vimrc
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'sheerun/vim-polyglot'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'airblade/vim-gitgutter'
Plug 'w0rp/ale'
Plug 'vim-airline/vim-airline'
const ALL_POSTS = graphql`
query($orderBy: PostOrderBy) {
allPosts(orderBy: $orderBy) {
title
content
createdAt
updatedAt
}
}
`;
@malbernaz
malbernaz / index.html
Created August 25, 2017 18:25
JSX Web components
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>webcomponents test</title>
<style>
body {
margin: 0;
atom sync
@malbernaz
malbernaz / catdownloader.js
Created April 14, 2016 01:51
Download a bunch of cat pics (thanks to the Cat API)
'use strict'
const http = require('http'),
fs = require('fs')
let i = 0,
url = 'http://thecatapi.com/api/images/get?format=src&type=jpg'
function request(url) {