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 / 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

@trico
trico / intereses.js
Created May 30, 2011 22:34
Expresión regular para obtener intereses
var re = /%interes%&i=([a-z0-9A-Z]*)&u=(\S*)/g,
text = 'href="%interes%&i=SoyUnInteres&u=http://google.es/?%moglaA2%20 texto sobre el texto de textos a mas textos %Q /ht href="%interes%&i=OtroInteres&u=http://popplers.com"',
matched = null;
while( (matched=re.exec(text)) != null )
console.log(matched[1] + ' = ' + matched[2].replace('"', ''));
@trico
trico / intereses.js
Created June 2, 2011 08:11
Editor intereses
$('<input type="button">').attr('id', 'op').attr('value', 'Obt').appendTo('body');
$('#op').live('click' , function(){
var re = /%interes%&i=([a-z0-9A-Z]*)&u=(\S*)/g,
text = $('#news').val(),
matched = null;
while( (matched=re.exec(text)) != null ){
console.log(matched[1]);
$('<p>').attr('id', matched[1] + '_p').appendTo('body');
@trico
trico / local.php
Created June 21, 2011 23:10
Pruebas con localStorage
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<body>
<a href="javascript:void(0)" id="clear">Clear Localstorage</a>
<div id="holas" data-store="holas" class="storeit">
<?php if(!$_COOKIE['holas']){?>
<ul>
<?php for ($i = 1; $i <= 10000; $i++) {?>
<li><?php echo $i?></li>
<?php }?>
</ul>
@trico
trico / gist:1050747
Created June 28, 2011 08:41
Extraer todas las urls de una cadena
var re = /http([^"'\s]+)/g,
text = 'href="%interes%&i=SoyUnInteres&u=http://google.es/?%moglaA2%20 texto sobre el texto de textos a mas textos %Q /ht href="%interes%&i=OtroInteres&u=http://popplers.com"',
encontrados = text.match(re);
console.log(encontrados);
@trico
trico / gist:1127213
Created August 5, 2011 09:40
each javascript
Array.prototype.each = function(fn){
var len = this.length;
for(i = 0; i < len; i++){
fn(this[i]);
}
};
['mogla', 'es', 'dios'].each(function(v){
console.log(v);
});
@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)}
{
"menu"
}
@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
sudo mount -t vboxsf E_DRIVE /home/marcoftheknight