This file contains hidden or 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
/usr/bin/google-chrome-stable %U --disable-new-avatar-menu --high-dpi-support=1 --force-device-scale-factor=1 |
This file contains hidden or 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
[HttpPost("[action]")] | |
public async Task<IActionResult> UploadFile(IEnumerable<IFormFile> files) | |
{ | |
foreach (var formFile in files) | |
{ | |
// Archivos existentes | |
const string ruta = "/home/eliu/Downloads/qwerty.txt"; | |
var mimeFile = MimeGuesser.GuessMimeType(ruta); | |
// Archivos que están siendo subidos al servidor |
This file contains hidden or 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
module DocumentFileTypes | |
module Microsoft | |
WORD = %w( | |
application/msword | |
application/vnd.openxmlformats-officedocument.wordprocessingml.document | |
application/vnd.openxmlformats-officedocument.wordprocessingml.template | |
application/vnd.ms-word.document.macroEnabled.12 | |
application/vnd.ms-word.template.macroEnabled.12 | |
) | |
This file contains hidden or 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
// carrito.html | |
$(document).on('click', '#btnConfirmar', function () { | |
if (localStorage.id_usuario) { | |
$.post('../sys/ws/pedido.php', { | |
op:'confirma_cart', | |
id_pedido: localStorage.id_pedido | |
}, function (response) { | |
localStorage.removeItem("id_pedido"); | |
InstantClick.go('index.html'); | |
}); |
This file contains hidden or 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 | |
// 27/5/2016 | |
$fecha = str_replace('/','-', '27/05/2016'); // String -> 27-05-2016 | |
$fecha = strtotime($fecha); //1464332400 | |
$fecha = date('Y-m-d',$fecha); //String -> 2016-05-27 | |
$fecha = date_create($fecha); //2016-05-27 00:00:00.000000 |
This file contains hidden or 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
.image { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
width: 120px; | |
height: 120px; | |
margin:-60px 0 0 -60px; | |
-webkit-animation:spin 1s linear infinite; | |
-moz-animation:spin 1s linear infinite; | |
animation:spin 1s linear infinite; |
This file contains hidden or 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 | |
public function validaRucAction(array $ruc){ | |
$values = array(5,4,3,2,7,6,5,4,3,2,0); | |
$sum = 0; | |
$valido = false; | |
for($i = 0; $i < strlen($ruc[0]); $i++){ | |
$sum += intval($ruc[0][$i]) * intval($values[$i]); | |
} |
This file contains hidden or 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
DELIMITER $$ | |
CREATE PROCEDURE sp_fail() | |
BEGIN | |
DECLARE _rollback BOOL DEFAULT 0; | |
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET _rollback = 1; | |
START TRANSACTION; | |
INSERT INTO tablea (date) VALUES (NOW()); | |
INSERT INTO tableb (date) VALUES (NOW()); | |
INSERT INTO tablec (date) VALUES (NOW()); -- FAIL | |
IF _rollback THEN |
This file contains hidden or 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
.ui-page{ | |
height: 100%; | |
.ui-content{ | |
min-height: 100%; | |
} | |
} |
This file contains hidden or 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 thumbnail($path){ | |
list($ancho, $alto) = getimagesize($path); | |
$nuevo_ancho = $nuevo_alto = 150; | |
$ext = '.'.pathinfo($path, PATHINFO_EXTENSION); | |
$name = pathinfo($path, PATHINFO_FILENAME); | |
$dir = pathinfo($path, PATHINFO_DIRNAME); | |
$thumb = imagecreatetruecolor($nuevo_ancho, $nuevo_alto); |
NewerOlder