Skip to content

Instantly share code, notes, and snippets.

View joelpurra's full-sized avatar
🗺️
Working remotely

Joel Purra joelpurra

🗺️
Working remotely
View GitHub Profile
@joelpurra
joelpurra / UrlCssHelper.cs
Created March 30, 2012 18:05
UrlCssHelper: A helper extending ASP.NET MVC3 with simple ID and CSS class generators for page level elements, to make per-page or per-feature CSS includes/rules simpler
//-----------------------------------------------------------------------
// <copyright file="UriCssHelper.cs" company="The Swedish Post and Telecom Authority (PTS)">
// Copyright (c) 2011, 2012 The Swedish Post and Telecom Authority (PTS)
// Developed for PTS by Joel Purra <http://joelpurra.se/>
// Released under the BSD license.
// </copyright>
//-----------------------------------------------------------------------
// https://gist.github.com/2253509
namespace JoelPurra.Web.Helpers
@joelpurra
joelpurra / README.md
Last active October 2, 2015 13:58
AutoCleanCallback: Automatic HTML input field cleaning onkeyup/onchange using jQuery
@joelpurra
joelpurra / jquery.validate.unobtrusive.dynamic.js
Created April 11, 2012 15:19
$.validator.unobtrusive.parseDynamicContent by XHalent, modified to keep a reference to the jQuery selector/context object
/// <reference path="../jquery-1.7.js" />
/// <reference path="../jquery.validate.js" />
/// <reference path="../jquery.validate.unobtrusive.js" />
// Originally by XHalent, @xhalent
// http://xhalent.wordpress.com/
// http://xhalent.wordpress.com/2011/01/24/applying-unobtrusive-validation-to-dynamic-content/
// Modified by Joel Purra
// http://joelpurra.com/
@joelpurra
joelpurra / MvcAnnotationHelper.cs
Created April 16, 2012 13:49
MvcAnnotationHelper: Helps output formatted HTML from model properties.
//-----------------------------------------------------------------------
// <copyright file="MvcAnnotationHelper.cs" company="The Swedish Post and Telecom Authority (PTS)">
// Copyright (c) 2011, 2012 The Swedish Post and Telecom Authority (PTS)
// Developed for PTS by Joel Purra <http://joelpurra.se/>
// Released under the BSD license.
// </copyright>
//-----------------------------------------------------------------------
// https://gist.github.com/2398934
namespace JoelPurra.Web.Helpers
@joelpurra
joelpurra / MvcScriptHelper.cs
Created April 16, 2012 13:52
MvcScriptHelper: Helps render multiple script blocks from multiple pages/layouts/partial views, in the expected order
//-----------------------------------------------------------------------
// <copyright file="MvcScriptHelper.cs" company="The Swedish Post and Telecom Authority (PTS)">
// Copyright (c) 2011, 2012 The Swedish Post and Telecom Authority (PTS)
// Developed for PTS by Joel Purra <http://joelpurra.se/>
// Released under the BSD license.
// </copyright>
//-----------------------------------------------------------------------
// https://gist.github.com/2398969
namespace JoelPurra.Web.Helpers
@joelpurra
joelpurra / InheritedClassModelBinder.cs
Created April 18, 2012 18:26
InheritedClassModelBinder: A ModelBinder for ASP.NET MVC3 that handles creating concrete class instances mapped to an abstract superclass. Based on code by Kelly.
namespace JoelPurra.Web.Binders
{
using System;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Web.Mvc;
using rDoing.Scraper.Web.Mvc.Controllers.ViewModels.Binder.Helpers;
/// <remarks>
/// Based on
@joelpurra
joelpurra / changepolling.joelpurra.js
Created June 17, 2012 15:53
A jQuery plugin to check if the value has changed in an input/select/textarea without relying on the jQuery .change() event. This is perfomed using polling at a configurable interval, which will then trigger the .change() event.
/*!
* @license ChangePolling
* Copyright © 2012 Joel Purra <http://joelpurra.se/>
* Released under MIT, BSD and GPL license. Comply with at least one.
*
* A jQuery plugin to check if the value has changed in an input/select/textarea
* without relying on the jQuery .change() event. This is perfomed using polling
* at a configurable interval, which will then trigger the .change() event.
*/
// https://gist.github.com/2944926
@joelpurra
joelpurra / objectcomparator.joelpurra.js
Created June 24, 2012 20:17
A javascript plugin to create a comparator for one or more properties of an object. Comparators are useful for sorting arrays of objects, and for general comparisons in, for example, if statements. The comparison is done only if the types of both objects'
/*!
* @license ObjectComparator
* Copyright © 2012 Joel Purra <http://joelpurra.se/>
* Released under MIT, BSD and GPL license. Comply with at least one.
*
* A javascript plugin to create a comparator for one or more properties of an object.
* Comparators are useful for sorting arrays of objects, and for general comparisons
* in, for example, if statements.
* The comparison is done only if the types of both objects' property matches.
*/
@joelpurra
joelpurra / README.md
Last active October 6, 2015 16:57
A jQuery plugin to show and hide follow up questions in a form. The follow ups are specified through HTML5 [data-*] attributes.