Eliminamos el ultimo commit manteniendo los cambios
git reset --soft HEAD~1
Eliminamos el ultimo commit descartando los cambios
git reset --hard HEAD~1
<?php | |
$timestamp = strtotime('last week'); | |
echo gmdate("Y-m-d\TH:i:s\Z", $timestamp) . '<br>'; | |
echo 'Semana pasada: '.date('Y-m-d H:i:s',strtotime("-7 days")); | |
?> |
SELECT IF(p.campo_booleano < 1, "TRUE", "FALSE") boolean | |
FROM tabla |
function generateUUID() { | |
var d = new Date().getTime(); | |
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = (d + Math.random()*16)%16 | 0; | |
d = Math.floor(d/16); | |
return (c=='x' ? r : (r&0x3|0x8)).toString(16); | |
}); | |
return uuid; | |
} |
/** | |
* Devuelve el segmento URI de la URL proporcionada | |
* @param {Number} param_position Parametro que se desea obtener, puede ser false para obtener todos los parametros | |
* @param {String} main_name Texto a partir del cual empiezan los segmentos a buscar | |
* @param {String} url url donde buscar | |
* @return {Mixed} false en caso de error, un string con los parametros seleccionados o string vacio si no encuentra parametros | |
*/ | |
function uriSegment(param_position, main_name, url) { | |
var index, | |
urlArray; |
// Random entre 1 y 10 | |
var randomString = ((Math.random() * 10) +1).toString(32); |
<form id="my_form"> | |
<input type="file" id="img-input-file"> | |
<img id="#img-input-file-preview" src="#" alt="imagen" /> | |
</form> |
Eliminamos el ultimo commit manteniendo los cambios
git reset --soft HEAD~1
Eliminamos el ultimo commit descartando los cambios
git reset --hard HEAD~1
function is_empty(data) { | |
var count = 0, i; | |
if (typeof data === 'number') { | |
return false; | |
} | |
if (typeof data === 'boolean') { | |
return !data; | |
} |
String.prototype.humanize = function (str) { | |
return str.replace(/\w\S*/g, function (txt) {return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); }); | |
}; |
<?php | |
function vimeoID($url) { | |
if (preg_match("/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/", $url, $id)) { | |
return "<strong>".$id[3]."</strong>"; | |
} else { | |
return "<strong class='error'>error</strong>"; | |
} | |
} | |
$vimeo = array( |