Skip to content

Instantly share code, notes, and snippets.

@pepegar
pepegar / gist:4557296
Created January 17, 2013 16:31
marcar item de menu wordpress por nombre
$(document).ready(function() {
$('#menu-item-13 .menu-item>a').each(
function(index){
if ($(this).html() == 'Ecológicos'){
$(this).parent().addClass('current-menu-item')
}
}
);
});
@pepegar
pepegar / svn_short_log
Last active December 12, 2015 08:58 — forked from plexus/svn_short_log
#!/usr/bin/awk -f
# Convert the "svn log" output into a one liner format, which is easier to grep
# or use in scripts. Pipe "svn log" into this script
# When we get a line that starts with a revision number, put the data in variables
/^r[0-9]+/ {
rev=$1
user=$3
date=$5
@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++)
@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 / 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

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 / 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 E94A FA72 3848 09F2 081D D1AF 3DD7 497C FE9B EFE3

To claim this, I am signing this object:

@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