Skip to content

Instantly share code, notes, and snippets.

View mig1098's full-sized avatar

miglio esaud mig1098

View GitHub Profile
@mig1098
mig1098 / execute.php
Last active August 16, 2019 06:53
aumentar el procesos de un archivo
<?php
ini_set("max_execution_time", "-1");
ini_set("memory_limit", "-1");
ignore_user_abort(true);
set_time_limit(0);
@mig1098
mig1098 / hand.svg
Created July 11, 2019 22:07
svg hand
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mig1098
mig1098 / jquery.browser.js
Last active July 10, 2019 15:59
jquery browser, Uncaught TypeError: Cannot read property 'msie' of undefined
/* Uncaught TypeError: Cannot read property 'msie' of undefined */
/* add to jquery to fix */
jQuery.browser = {};
(function () {
jQuery.browser.msie = false;
jQuery.browser.version = 0;
if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
jQuery.browser.msie = true;
jQuery.browser.version = RegExp.$1;
}
@mig1098
mig1098 / settings.json
Created June 27, 2019 00:52
vscode php intellisense json configuration
{
"php.validate.enable": true,
"php.validate.executablePath": "C:\\Users\\Administrador\\AppData\\Local\\Programs\\php\\php7.0.10\\php.exe",
"php.validate.run": "onType",
"php.executablePath": "C:\\Users\\Administrador\\AppData\\Local\\Programs\\php\\php7.0.10\\php.exe",
"window.zoomLevel": -1,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"workbench.iconTheme": "Monokai Pro Icons",
"workbench.colorTheme": "Dark++"
}
@mig1098
mig1098 / readcsv.php
Created March 19, 2019 17:10
Read csv files from csv. PHP
<?php
//tmp_name from input file
//@param array $tmp
//@return array
function leercsv($tmp){
$arrayData = array();
if(!($handle = @fopen ($tmp, 'rb'))){
throw new \Exception('Error en la carga del fichero');
}else{
$row = 1;
@mig1098
mig1098 / readexcel.php
Last active March 19, 2019 16:56
Read data from excel. PHPExcel library
<?php
include('../PHPExcel/PHPExcel/IOFactory.php');
//@param $temp_file path name of file or tmp_name from input file
function leerArchivoExcelCsv($temp_file){
$arrayData = array();
$inputFileName = $temp_file;
/*check point*/
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($inputFileName);
@mig1098
mig1098 / .htaccess
Created January 30, 2019 13:54
codeigniter htaccess
Options FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
@mig1098
mig1098 / download_wav.php
Created October 24, 2018 20:13
headers for download wav audio
$ctype ='audio/x-wav';
$filepath = '/var/www/html/audio.wav';
$size = filesize($filepath);
$name = basename($filepath);
$fp=fopen($fichero, "rb");
if ($size && $ctype && $fp) {
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
@mig1098
mig1098 / javascript_unicode.html
Last active February 27, 2024 21:18
javascript unicode accents
Question: Can I display accented characters or ligatures as part of JavaScript output?
Answer: You can include accented characters and ligatures in JavaScript strings and/or display them on your HTML pages using the following encodings for the letters:
hexadecimal codes \xXX in JavaScript strings; e.g. ñ is \xF1
Unicode hex codes \uXXXX in JavaScript strings; e.g. š is \u0161
HTML entities; for example, ñ is &ntilde; and š is &scaron;
numeric HTML entities; e.g. ñ is &#241; and š is &#353;
unescape with a suitable argument; e.g. ñ is unescape('%F1')
decodeURI with a suitable argument; e.g. ñ is decodeURI('%C3%B1')
@mig1098
mig1098 / curl.md
Created July 31, 2018 14:16 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.