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
@trico
trico / gist:3817341
Created October 2, 2012 08:31
alternativa text-indent
height: 0; overflow: hidden; padding-top: 20px;
@trico
trico / gist:3163810
Created July 23, 2012 14:11
Curl php proxy
<?php
$url = 'url';
$proxyauth = 'user:pass';
$proxy = 'proxy.server.es';
$proxyPort = '8080';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
//proxy suport
@trico
trico / try.json
Last active October 6, 2015 16:48
[
{
"es": "lunes",
"en": "monday"
},
{
"es": "martes",
"en": "tuesday"
}
,
@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);
}
@trico
trico / sublime.bat
Created May 6, 2012 15:30
Git commit msg
"C:\Program Files\Sublime Text 2\sublime_text.exe" --wait --new-window "%1"
#!/usr/bin/python
import subprocess
archivos = subprocess.check_output(["git", "diff", "HEAD^", "HEAD", "--name-only"])
try:
print subprocess.check_output("grep -nHe console " + archivos.replace('\n', ' '), stderr=subprocess.STDOUT, shell=True)
except Exception, e:
print
sudo mount -t vboxsf E_DRIVE /home/marcoftheknight
@trico
trico / .bash_profile
Created February 21, 2012 15:35
Alias y comandos sh
# Alias node
alias node="D:\node.exe"
# Alias python
alias python="C:/Python27/python.exe"
# Alias a la carpeta de programas python
alias fl="c:/Users/eponce/python"
# Comandos chachi
{
"menu"
}
@trico
trico / numeros.js
Created December 12, 2011 15:12
Comprueba si la cadena contiene números
function(a){return!/[0-9]+/g.test(a)}