Skip to content

Instantly share code, notes, and snippets.

@vlko
vlko / jquery.ielt9.html5.ajax
Created December 20, 2010 23:08
support for html5 elements in jquery ajax
// jquery append workaround for support of html5 elements in ajax in ie less that 9
$(function () {
if ($.browser.msie && $.browser.version < 9) {
$.fn.append = function () {
this.domManip(arguments, true, function (E) {
if (this.nodeType == 1) {
if (E.nodeType == 11) E = innerShiv(E, false);
if (E.nodeType) {
@vlko
vlko / gist:d19875d85e26c4655468
Last active August 29, 2015 14:18
RX.net: Async download with limited concurrency
private ISubject<string> _downloaderSubject = new Subject<string>();
var processing = _downloaderSubject
.Select(url => Observable.FromAsync(x => downloader.GetData(url))
.Catch((Exception ex) => Observable.Throw<JsonData>(ex).DelaySubscription(TimeSpan.FromMilliseconds(1000)))
.Retry(3)
.Catch<JsonData, Exception>(ex =>
{
_logger.Error("Failed to download", ex);
return Observable.Empty<JsonData>();
}))
@vlko
vlko / MiniProfilerRavenDBIntegration.cs
Created December 21, 2021 18:03
MiniProfiler RavenDB integration
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Raven.Client.Documents;
using Raven.Client.Documents.Session;
using StackExchange.Profiling;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;