Skip to content

Instantly share code, notes, and snippets.

Palmer Oliveira expalmer

View GitHub Profile
@expalmer
expalmer / t11.c
Last active Mar 14, 2019
Sistemas Distribuidos
View t11.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int nEp = 1;
int tam = 12;
int n = 4;
int *vA = (int *)malloc(tam * sizeof(int));
View parserLexico.jflex
import java.io.*;
%%
%byaccj
%{
// Armazena uma referencia para o parser
private Parser yyparser;
@expalmer
expalmer / arquivo.txt
Last active Oct 3, 2017
Analisador Léxico
View arquivo.txt
a
a
int
asd
as123
99
99.
99.999
float
real a
@expalmer
expalmer / index.html
Last active Aug 4, 2017
Budo + React + ES6 + Babel
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>App</title>
</head>
<body>
<div id="app"></div>
<script src="index.js"></script>
</body>
View index.js
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 Mar 29, 2017 — forked from csswizardry/README.md
Vim without NERD tree or CtrlP
View README.md

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 Mar 5, 2016
Todo List Vanilla JS
View helpers.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 Jan 27, 2016 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
View slim-redux.js
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 Jan 6, 2016
input e ul
View app.js
localStorage.test = '';
var stores = new Stores('test');
var datas = [
{ name: 'Eric' },
{ name: 'Jean' },
{ name: 'Pablo' },
{ name: 'Palmer' },
{ name: 'Pepo' }
You can’t perform that action at this time.