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]; |
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
-- Adminer 4.1.0 MySQL dump | |
SET NAMES utf8; | |
SET time_zone = '+00:00'; | |
SET foreign_key_checks = 0; | |
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
DROP TABLE IF EXISTS `heatmap`; | |
CREATE TABLE `heatmap` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, |
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 order array | |
private static function _getSerialDataSubstitute($data, $extraArray = null) | |
{ | |
$array = array(); | |
//$data = !empty($data[0]) ? $data[0] : array(); | |
$c = 0; | |
if (is_array($data) && count($data) > 0) { |