Skip to content

Instantly share code, notes, and snippets.

@rocklan
rocklan / ThrottleFilter.cs
Last active August 14, 2019 13:25
WebApi bandwidth throttling
using System;
using System.Net;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Web;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
namespace Throttling
{
@Soopster
Soopster / MessageLock
Created April 16, 2015 09:32
Message Lock Renewal For Azure Service Bus Brokered Messages
private async Task OnMessageReceivedAsync(BrokeredMessage receivedMessage)
{
try{
var messageLock = new MessageLock(receivedMessage)){
// Process receivedMessage
await messageLock.CompleteAsync();
}
finally {
messageLock.Dispose();
@mausch
mausch / git-shallow-submodule.sh
Created November 18, 2010 17:10
Shallow-cloned submodules in git
#!/bin/bash
# Idea from http://stackoverflow.com/questions/2144406/git-shallow-submodules
git submodule init
for i in $(git submodule | sed -e 's/.* //'); do
spath=$(git config -f .gitmodules --get submodule.$i.path)
surl=$(git config -f .gitmodules --get submodule.$i.url)
git clone --depth 1 $surl $spath
done
git submodule update