Skip to content

Instantly share code, notes, and snippets.

View haskellcamargo's full-sized avatar
🪲
Everything is terrible

Marcelo Camargo haskellcamargo

🪲
Everything is terrible
View GitHub Profile
@haskellcamargo
haskellcamargo / PeanoSum.hs
Created October 22, 2016 20:58
Sum without + operator and even literal numbers!
module PeanoSum where
-- Written by Marcelo Camargo <[email protected]> on
-- Sat Oct 22 2016
-- Represent natural numbers
data Nat = Zero
| Succ Nat
-- Let neutral element of Monoid be id
-- Let (Functor a) b become Functor (a .+. b)
@haskellcamargo
haskellcamargo / .vimrc
Created August 24, 2016 11:28
Celão's Vim
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
@haskellcamargo
haskellcamargo / .vimrc
Last active August 3, 2016 17:27
Camargo's Vim Configuration
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
// Não otimizado, acumulo na stack
var map = (f, xss) => 0 === xss.length
? []
: [f(xss[0])].concat(map(f, xss.slice(1)));
// Exemplo
map(x => x * 2, [1, 2, 3])
// Itens na stack:
// map(function, [1, 2, 3])
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
var shitPosting;
function clearShitFromAPDA() {
Array.prototype.slice.call(document.getElementsByClassName('userContent'), 0)
.filter(x => x.innerText.match(/^\[off\]/i))
.map(x => x.parentNode.parentNode)
.forEach(x => x.parentNode.removeChild(x));
shitPosting = setTimeout(clearShitFromAPDA, 1000);
}
@haskellcamargo
haskellcamargo / .vimrc
Created July 20, 2016 19:27
My Vim config
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
@haskellcamargo
haskellcamargo / JSONParser.hs
Created July 4, 2016 23:21 — forked from zearen/JSONParser.hs
A simple haskell demonstation showing parsing JSON with Parsec
{-
Zachary Weaver <[email protected]>
JSONParser.hs
Version 0.1.1
A simple example of parsing JSON with Parsec in haskell. Note that
since the primary point of this excersize is demonstration,
Text.Parsec.Token was avoided to expose more of the grammar. Also,
complicated optimizations and shorcuts were avoided (mostly).
(import [os [listdir remove]])
(import [os.path [isfile join]])
(import [sys [argv]])
; Path for tests
(setv test-dir "./tests")
; Extension for the tests
(setv test-ext ".qtest")
; List all the files in the test suit