This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.fn.dynamicForm = function (options) { | |
var config = $.extend({}, $.fn.dynamicForm.defaults, options), | |
$this = $(this), | |
$inputs = $this.find(config.container), | |
$add = $this.find(config.addButton), | |
$remove = $this.find(config.removeButton), | |
counter = $inputs.children().length; | |
$add.on('click', function (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
/** | |
* Preloader for Font Families. This will preload fonts used with CSS @font-face. | |
* @param fontFamilies {string[]} A collection of font family names to preload. | |
*/ | |
var preloadFontFamilies = function (fontFamilies) { | |
// Create a hidden container. | |
// | |
var containerElement = document.createElement('div'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AspNetUtilities { | |
export interface IAspNetFormValueDictionary { | |
[key: string]: any; | |
} | |
function collectAspNetFormKeyValues(keyPrefix: string, source: Object, dictionary: IAspNetFormValueDictionary) { | |
var localKeyPrefix = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwedishPersonalIdentityNumber | |
{ | |
/// <summary> | |
/// Pattern for finding common ways of writing a Swedish personal identity number. It is forgiving and will match the format rather than valid numbers. | |
/// | |
/// Illustrating how it works: | |
/// ((19)99)(06)(01)(-)((01)|(TF))(1)(1) | |
/// </summary> | |
private const string RegexPattern = @"^(?<year>((19)|(20))?(\d\d))(?<month>[01]\d)(?<day>\d\d)(?<flag>[-]|[\+])?(?<county>(\d\d)|(TF))(?<gender>\d)(?<checksum>\d)$"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:document.write('<pre>'+JSON.stringify(JSON.parse(document.body.textContent),null,'\t')+'</pre>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Canvas Rendering Fix | |
// | |
if (window.CanvasRenderingContext2D) { | |
var arc = CanvasRenderingContext2D.prototype.arc, | |
arcTo = CanvasRenderingContext2D.prototype.arcTo, | |
bezierCurveTo = CanvasRenderingContext2D.prototype.bezierCurveTo, | |
clearRect = CanvasRenderingContext2D.prototype.clearRect, | |
fillRect = CanvasRenderingContext2D.prototype.fillRect, | |
lineTo = CanvasRenderingContext2D.prototype.lineTo, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery.resize.events.js | |
* | |
* Trigger events for 'resizestart' and 'resizeend' on $(window). | |
* @param {Number} timeoutms Defines the time in milliseconds before the 'resizeend' event is triggered. | |
* | |
* Version: 1.0 | |
* Author: Martin Eriksson | |
*/ | |
(function ($, timeoutms) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array Polyfills | |
// --------------- | |
(function () { | |
if (!Array.prototype.indexOf) { | |
// Production steps of ECMA-262, Edition 5, 15.4.4.14 | |
// Reference: http://es5.github.com/#x15.4.4.14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//javascript: | |
(function($){ | |
function css() { | |
$('link[rel=stylesheet]').each(function(){ | |
var $link=$(this); | |
var i=$link.attr('href').indexOf('?'); | |
$link.clone().attr('href', $link.attr('href').substr(0, i > 0 ? i : undefined) + ('?' + Math.random()).replace('.', '')).load(function(){ | |
$link.remove(); | |
}).appendTo('head'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jquery.radioDefault.js | |
* Sets the first radio button of each radio button group to checked. | |
* | |
* Version: 1.0 | |
* Author: Martin Eriksson | |
*/ | |
(function ($) { |