Skip to content

Instantly share code, notes, and snippets.

View expalmer's full-sized avatar

Palmer Oliveira expalmer

View GitHub Profile
const Box = x => (
{
map: f => Box(f(x)),
fold: f => f(x)
}
);
const splitEvery = (list, n) => {
const result = [];
let idx = 0;
@expalmer
expalmer / README.md
Created March 29, 2017 17:53 — forked from csswizardry/README.md
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vsp **/*<partial file name><Tab>
@expalmer
expalmer / helpers.js
Created March 5, 2016 14:55
Todo List Vanilla JS
;(function(context) {
'use strict';
function $( selector, scope ) {
return $.qsa( selector, scope, true );
}
$['qsa'] = function( selector, scope, first ) {
var e = ( scope || document).querySelectorAll( selector );
@expalmer
expalmer / slim-redux.js
Created January 27, 2016 16:51 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@expalmer
expalmer / app.js
Last active January 6, 2016 16:22
input e ul
localStorage.test = '';
var stores = new Stores('test');
var datas = [
{ name: 'Eric' },
{ name: 'Jean' },
{ name: 'Pablo' },
{ name: 'Palmer' },
{ name: 'Pepo' }

Teste para projetos responsivos

##Problema Testar/verificar a disposição dos elementos de uma determinada página em determinadas resoluções de tela.

Solução

Executar captura de telas de acordo com os viewports definidos em um script, com a ajuda do PhantomJS.

Necessário ter o node e o npm instalados

@expalmer
expalmer / gist:6693109
Created September 25, 2013 00:05
Vagrant Configuration 1.3.3
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "devPhp"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
function soma (a, b) {
return a + b
}
module.exports = soma
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hellobits"
config.vm.box_url = "http://hellobits.com/vagrant/hellobits.box"
config.vm.synced_folder ".", "/Projects", id: "vagrant-root"
# config.vm.network :private_network, ip: "192.168.50.2"
forward_port = ->(guest, host = guest) do