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
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 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
// 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
$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
mysql> SELECT CURRENT_TIMESTAMP(); | |
+---------------------+ | |
| CURRENT_TIMESTAMP() | | |
+---------------------+ | |
| 2016-04-12 14:31:59 | | |
+---------------------+ | |
1 row in set | |
mysql> SELECT @@global.time_zone, @@session.time_zone; | |
+--------------------+---------------------+ |
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
RewriteRule ^loquesea$ http://www.otrodominio.com/otrodirectorio [R=301,NC,L] |
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
<div class="modal fade" id="modal-id" tabindex="-1" role="dialog"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
<h4>Título</h4> | |
</div> | |
<div class="modal-body" style="max-height: calc(100vh - 212px);overflow-y: auto;"> | |
<div class="list-group"> | |
</div> |
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
-- Crear nuevo campo | |
ALTER TABLE `test` ADD COLUMN `ts_year_month` int(11); | |
-- Insertar valores en el campo para los registros actuales | |
UPDATE `test` SET ts_year_month = DATE_FORMAT(fecha,'%Y%m'); | |
-- Actualizar la definición de la nueva columna | |
ALTER TABLE `test` MODIFY `ts_year_month` int(11) NOT NULL; | |
-- Añadir el nuevo campo al índice |
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
SELECT * FROM tabla ORDER BY FIELD(tipo,'ANTES','DURANTE','DESPUES') ASC |