Skip to content

Instantly share code, notes, and snippets.

@pepegar
pepegar / init.vim
Last active November 19, 2019 23:28
" plugins {{{
call plug#begin('~/.local/share/nvim/plugged')
Plug 'davidhalter/jedi-vim'
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
Plug 'derekwyatt/vim-scala'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'bling/vim-airline'
@pepegar
pepegar / server.py
Created December 12, 2018 08:00
server.py
#%%
from flask import Flask, jsonify
server = Flask("simplest server ever")
@server.route("/hello")
def hello_handler():
return "hello again"
@pepegar
pepegar / printer-combinators.org
Created October 24, 2018 23:39
Printer combinators. The duality of parsing

Printing combinators

In the same way parsing combinators pave the way for doing parsing in a functional way, printing combinators do the same for printing.

Parsing combinators

But, what does parsing combinators mean?

Parsing combinators

Keybase proof

I hereby claim:

  • I am pepegar on github.
  • I am pepegar (https://keybase.io/pepegar) on keybase.
  • I have a public key whose fingerprint is E94A FA72 3848 09F2 081D D1AF 3DD7 497C FE9B EFE3

To claim this, I am signing this object:

@pepegar
pepegar / Blog.hs
Last active September 14, 2016 08:31
Applicative Blog
{-# LANGUAGE GADTs #-}
import Control.Applicative.Free
import Control.Applicative
type Author = String
type Post = String
type Id = Int
-- A page of the blog, that will consist of a post and its author

Keybase proof

I hereby claim:

  • I am pepegar on github.
  • I am pepegar (https://keybase.io/pepegar) on keybase.
  • I have a public key whose fingerprint is 3E6C 1019 8B2D C9CA CAED 9739 C67E 6BA0 4AED 9108

To claim this, I am signing this object:

@pepegar
pepegar / libeventfb.rb
Last active August 29, 2015 14:04 — forked from danslo/libeventfb.rb
require 'formula'
class Libeventfb < Formula
homepage 'http://libevent.org/'
url 'https://github.com/libevent/libevent.git', :tag => 'release-1.4.14b-stable'
version '1.4.14b'
keg_only 'We are just a patched version.'
depends_on :autoconf => :build
@pepegar
pepegar / newservice.php
Created August 22, 2013 09:01
This is a plugin for WordPress that extends the Media Explorer plugin with a new service. You may want to use it as a template
<?php
/*
Plugin Name: new service
Plugin URI: garhdez.com
Description: new service
Author: Pepe
*/
class MEXP_New_Template extends MEXP_Template {
@pepegar
pepegar / extremes.php
Created June 7, 2013 13:53
Get Extremes of integer array
<?php
function getExtremes($test)
{
$sum = array_sum($test);
$average = $sum / count($test);
$deviations = array();
$ret = array();
for ($i = 0; $i < count($test); $i++)