Skip to content

Instantly share code, notes, and snippets.

View trico's full-sized avatar
🚀
Brrrrrr

Eric Ponce trico

🚀
Brrrrrr
  • Barcelona, Spain
View GitHub Profile
@tj
tj / main.go
Last active April 10, 2017 06:58
package main
import (
"fmt"
"net/http"
"github.com/apex/go-apex"
"github.com/apex/go-apex/proxy"
)
@trico
trico / gist:2958648
Created June 20, 2012 07:35
Añadir una clase para cada uno de los elemento de wp_nav_menu
<?php
function new_nav_menu_items($output) {
$idstr = preg_match_all('/<li class="page_item page-item-(\d+)/', $output, $matches);
foreach($matches[1] as $mid){
$slug = basename(get_permalink($mid));
$output = preg_replace('/page-item-'.$mid.'(| current_page_item)">/', 'page-item-'.$mid.' page-item-'.$slug.'">', $output, 1);
}
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@trico
trico / comandos.md
Created May 18, 2011 22:15
Comandos git

####Crear una rama y directamente hacer checkout en ella git checkout -b myfeature develop

####Merge especial git merge --no-ff myfeature

####Eliminar una rama git branch -d myfeature

####Crear tag

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')