Skip to content

Instantly share code, notes, and snippets.

@SamSaffron
SamSaffron / Async.cs
Created June 7, 2012 06:13
Async class for threading
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Threading;
using System.Diagnostics;
using System.Text;
namespace StackOverflow.Helpers
@jaboc83
jaboc83 / sigPadCompression.js
Last active May 3, 2021 16:01
jQuery Signature Pad Compression/Decompression algorithm
/** Reinflates a compressed signature string:
resolution = a representation of the resolution in
pixels of the canvas which this signature will be drawn
e.g. {x:800,y:200}
*/
var inflateToJsonSignature = function (deflatedSig, resolution) {
var components = [],
modifier = 1,
compressWithResolution = /^(?:\[(\d+)x(\d+)\])?([\w\W]*)/,
parsedSigString = deflatedSig.match(compressWithResolution),