This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################# | |
# Push de la rama actual | |
git push origin $rama_actual | |
############################################# | |
# Volver a un commit anterior, descartando los cambios | |
git reset --HARD $SHA1 | |
############################################# | |
# Ver y descargar Ramas remotas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Filtro por intervalo desde ahora hasta hace 1 dia | |
SELECT | |
slots.slot, | |
slots.name, | |
slots.min, | |
slots.max, | |
AVG(datos.valor) valor | |
FROM slots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Funcion probado retorna miniatura con escala requerida. | |
* @url http://stackoverflow.com/questions/11376315/creating-a-thumbnail-from-an-uploaded-image | |
*/ | |
function makeThumbnails($updir, $img, $id) | |
{ | |
$thumbnail_width = 134; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function _uniqueFileInDirectory($pathFile) | |
{ | |
$rs = FALSE; | |
$pathFile = str_replace('\\', '/', $pathFile); // valid path if is format windows | |
$ext = pathinfo($pathFile, PATHINFO_EXTENSION); | |
$file = substr(strrchr($pathFile, "/"), 1); | |
$fileLessExt = str_replace(".$ext", '', $file); | |
$path = str_replace($file, '', $pathFile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show git branch | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="\[\033[00m\]\u@\h\[\033[01;33m\] \w \[\033[31m\]\$(parse_git_branch)\[\033[00m\]$\[\033[00m\] " | |
# Alternative for no show all path in prompt | |
# only change '\w' to '\W' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
ServerName chamiloutp.me | |
DocumentRoot /var/www/chamiloutp/ | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride All | |
</Directory> | |
<Directory /var/www/chamiloutp/> | |
Options Indexes FollowSymLinks Multiviews |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sql indicator only exist data in c_tool | |
* if true make join success. | |
* ------------------------------ | |
* SQL inner join fuera de lo normal | |
*/ | |
SELECT t.* FROM c_tool t | |
INNER JOIN ( | |
SELECT c_id, MAX(id) as id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
\r is carriage return; | |
\n is line feed. | |
* | |
*/ | |
// clean code Even better normalize the text. because you never know what OS visitors uses. | |
$getdata = str_replace("\r\n", "\n", $getdata); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
var_dump(debug_backtrace()); ECHO __FILE__; echo "UNSTALL EXTT"; EXIT; | |
// print error.log | |
error_log(print_r(debug_backtrace(), TRUE)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* function setting datetime compatible multiple navigator chrome and firefox | |
* @param stringDate 2014-07-28 03:42:23 | |
*/ | |
function _settingDateTime(stringDate) { | |
var myDate = new Date(); | |
//string | |
var arrayDate = stringDate.split(' '); | |
if (arrayDate.length > 0) { | |
var date = arrayDate[0]; |
OlderNewer