Skip to content

Instantly share code, notes, and snippets.

View sinner's full-sized avatar
:electron:
Crafting

José Gabriel González Pérez sinner

:electron:
Crafting
View GitHub Profile
@sinner
sinner / Connection.php
Last active December 17, 2015 06:18
Insert into While Loop, Data From CSV File
<?php
class Conecction {
protected static $db_name = 'MyDataBase';
protected static $user = 'MyUser';
protected static $passw = '';
@sinner
sinner / ajaxTools.js
Created April 30, 2013 15:57
Funciones útiles para efectuar peticiones ajax y validaciones en campos de texto. Useful functions to make ajax requests and validations in text fields. Requiere de jQuery1.7 o mayor... Require of jQuery1.7 or greater than.
var dialog = [];
dialog['error'] = 'errorDialogBox';
dialog['exito'] = 'successDialogBox';
dialog['alerta'] = 'alertDialogBox';
function displayHtmlInDivId(divResult, dataHtml, conEfecto){
if(conEfecto){
$("#"+divResult).html("").html(dataHtml).fadeIn();
}else{
$("#"+divResult).html("").html(dataHtml);
@sinner
sinner / ManageCallBackWithDoneEvent.js
Created March 20, 2013 20:58
Callback jQueryUpload and Setup for Excel Upload
$('#fileupload').on('fileuploaddone', function(e, data) {
//console.debug(data);
$.each(data.result, function (index, file) {
console.debug(file);
var datos = file[0];
$.ajax({
type: "POST",
dataType: "html",
data: datos,
url: "file.php",
@sinner
sinner / gist:5202745
Created March 20, 2013 06:32
Alternativa para el UploadHandler de jQueryFile Upload - Entre las lìneas 461 y 469
<?php
...
protected function get_file_name($name, $type, $index, $content_range) {
$name = $this->udate('YmdHisu').$name;
return $this->get_unique_filename(
$this->trim_file_name($name, $type, $index, $content_range),
$type,
$index,