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
$fecha = date_create_from_format('d/m/Y H:i:s', '08/09/1969 15:32:21'); | |
echo "Fecha: " . $fecha->format('Y-m-d H:i:s') . "<br/>"; | |
$horas = 24; | |
echo "Fecha+24h: " . $fecha->add(new \DateInterval('PT' . $horas . 'H'))->format('Y-m-d H:i:s') . "<br/>"; |
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
// http://www.tehplayground.com/#qhRHh31Lj | |
$codigos = array( | |
"12454"=>"98", | |
"75489"=>"45", | |
"36985"=>"12" | |
); | |
$lista_codigos_string = implode(",",array_keys($codigos)); |
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 tailCustom($filepath, $lines = 1, $adaptive = true) { | |
// Open file | |
$f = @fopen($filepath, "rb"); | |
if ($f === false) return false; | |
// Sets buffer size | |
if (!$adaptive) $buffer = 4096; |
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
copy /b *.txt newfile.txt |
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 exception_error_handler($errno, $errstr, $errfile, $errline ) { | |
throw new ErrorException($errstr, 0, $errno, $errfile, $errline); | |
} | |
set_error_handler("exception_error_handler"); |
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
<img src="imagenotfound.gif" alt="Image not found" onerror="this.src='imagefound.gif';" /> |
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 | |
if ( ! function_exists('array_group_by') ) : | |
/** | |
* Groups an array by a given key. | |
* | |
* Groups an array into arrays by a given key, or set of keys, shared between all array members. | |
* | |
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function. |
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
... | |
invalidHandler: function(e, validator){ | |
if(validator.errorList.length) | |
$('a[href="#' + jQuery(validator.errorList[0].element, '#tabs').closest(".tab-pane").attr('id') + '"]').tab('show') | |
}, | |
... |
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
DROP FUNCTION IF EXISTS fn_remove_accents; | |
DELIMITER | | |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000) | |
BEGIN | |
SET @textvalue = textvalue COLLATE utf8_general_ci;; | |
-- ACCENTS | |
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ'; |
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 (root, factory) { | |
if ( typeof define === 'function' && define.amd ) { | |
define([], factory(root)); | |
} else if ( typeof exports === 'object' ) { | |
module.exports = factory(root); | |
} else { | |
root.myPlugin = factory(root); | |
} | |
})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) { |