Skip to content

Instantly share code, notes, and snippets.

View EliuTimana's full-sized avatar
🚲
Working from home

Eliú Timaná EliuTimana

🚲
Working from home
View GitHub Profile
@EliuTimana
EliuTimana / start.sh
Created June 10, 2020 14:19
fix chrome blurry on ubuntu
/usr/bin/google-chrome-stable %U --disable-new-avatar-menu --high-dpi-support=1 --force-device-scale-factor=1
[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
@EliuTimana
EliuTimana / document_types.rb
Created December 29, 2017 05:12 — forked from acuppy/document_types.rb
All major document mime types (Microsoft Office, Apple iWork, Adobe PDF) as a Ruby Module
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
)
// 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');
});
127.0.0.1 mc.corel.com
127.0.0.1 apps.corel.com
@EliuTimana
EliuTimana / date_y_m_d.php
Created October 7, 2016 00:47
day/month/year to year-month-day in PHP
<?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
.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;
@EliuTimana
EliuTimana / valida_RUC.php
Last active October 24, 2015 19:17
Implementación del algoritmo para validación de formato de RUC en PHP | SUNAT Perú
<?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]);
}
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
@EliuTimana
EliuTimana / jquery.mobile.full.height.scss
Created September 15, 2015 22:01
jQuery Mobile | Full Height Content
.ui-page{
height: 100%;
.ui-content{
min-height: 100%;
}
}