Skip to content

Instantly share code, notes, and snippets.

View gon250's full-sized avatar
💃
I may be slow to respond.

Gonzalo gon250

💃
I may be slow to respond.
View GitHub Profile
@gon250
gon250 / baseAjaxCall.js
Created July 8, 2015 13:49
Base Ajax Call
//My answer Stackoverflow
// http://stackoverflow.com/a/30301335/2545964
function baseAjaxCall(option, sCb) {
var ajaxOptions = {
method: option.method || "GET",
url: option.url,
dataType: option.dataType || "xml",
success : function(data) {
var root = $($.parseXML(data)).find("Response");
@gon250
gon250 / IntroductionToObject-OrientedJavaScriptExample.js
Created May 18, 2015 13:14
Introduction To Object-Oriented JavaScript Example
(function ($) {
var APP = function () {
this.permanentId = $('.permanentId');
this.table = $('table');
this.lockButton = $('.btn-lock');
};
APP.prototype.start = function () {
var self = this;
this.permanentId.on("click", function () {
(function ($) {
/**
* @function
* @property {object} jQuery plugin which runs handler function once specified element is inserted into the DOM
* @param {function} handler A function to execute at the time when the element is inserted
* @param {bool} shouldRunHandlerOnce Optional: if true, handler is unbound after its first invocation
* @example $(selector).waitUntilExists(function);
*/
@gon250
gon250 / Example.cs
Last active June 4, 2018 15:23
EPPLUS - c#
[Authorize]
public ActionResult Export() {
try
{
var fileDownloadName = "FileName-" + DateTime.Now.ToShortDateString() + ".xlsx";
const string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
var clients = this._clientsRepository.Get();
var package = new ExcelPackage();
@gon250
gon250 / Example
Created May 12, 2015 14:50
access to a website(c#) from a class library and avoid .NET login
//GET COOKIE
var authCookie = _loginHelper.GetAuthCookie(email, password);
//SERIELIZE JSON
var jsonDetails = JsonConvert.SerializeObject(details);
//RESPONSE
var response = _portfolioHelper.HttpPost( _path, jsonDetails, authCookie);
var result = JsonConvert.DeserializeObject<Response<int?>>(response);
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Reflection;
@gon250
gon250 / iecors
Created May 5, 2015 15:43
Adds XDomainRequest IE CORS support to jQuery
// Based on https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js
(function( jQuery ) {
if ( window.XDomainRequest && !jQuery.support.cors ) {
jQuery.ajaxTransport(function( s ) {
if ( s.crossDomain && s.async ) {
if ( s.timeout ) {
s.xdrTimeout = s.timeout;
delete s.timeout;
@gon250
gon250 / main.js
Created April 27, 2015 09:22
tablesorter
$(document).ready(function () {
$.tablesorter.themes.bootstrap = {
// these classes are added to the table. To see other table classes available,
// look here: http://getbootstrap.com/css/#tables
table: 'table table-bordered table-striped',
caption: 'caption',
// header class names
header: 'bootstrap-header', // give the header a gradient background (theme.bootstrap_2.css)
sortNone: '',
sortAsc: '',
@gon250
gon250 / gulpfile.js
Created April 13, 2015 08:22
Quick example - gulp
"use strict";
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
browserSync = require('browser-sync'),
runSequence = require('run-sequence'),
reload = browserSync.reload;
gulp.task('lint', function() {
return gulp.src('./app/**/*.js')
using Ninject;
using MMWebsites.DAL.Helpers;
using MMWebsites.DAL.Repository;
using MMWebsites.Global.Contracts;
using MMWebsites.Global.Helpers;
namespace MMWebsites.IoC
{
public class DependencyInjectionProvider