Allow one concurrent request per IP for an action

We had a situation at work where we needed to throttle/limit file uploads so that the user only can upload one file simultaneously in our Web API. So I wrote this Action Filter that will throttle requests by IP and only allow one concurrent request for that action. At work we edited the script to throttle per user (from session), instead of IP. We use the filter for our Web Api endpoint, but it should work the same for an MVC action. Any feedback is greatly appreciated, here it is: …

Simple TypeScript AMD Example

I have been hard at work building a web application based on TypeScript. TypeScript is just a blessing, but it took me a while to get the AMD part just right. It is important to keep every class in its own file and exporting it later: Here is an example: If you are building an SPA application with TypeScript, the new RavenDB is great inspiration: Raven Studio HTML5 …

Really, Really great stockphotos

Heads up, this is a complete reblog! Go here for Original Source. Anywho, I came by these super great Stock photographs, or as the original title said: Stock photos that do not suck. Here is the list: http://littlevisuals.co/ http://unsplash.com/ http://join.deathtothestockphoto.com/ http://nos.twnsnd.co/ (old looking) http://superfamous.com/ (aerial photos) http://picjumbo.com/ http://thepatternlibrary.com/ (pattern library) http://www.gratisography.com/ http://getrefe.tumblr.com/ http://imcreator.com/free …

I built Crowdspell - a free service for correcting typos

I have a tradition where I develop something new every Christmas holiday. Last year I built a notepad clone with web technologies, still available at http://notepad.azurewebsites.net. My goal with these Christmas hacks is to learn something new and to really finish something. Last year I learned about offline web applications and this year I learned about CORS, Widget developing, Typescript and VanillaJS. This year, I built Crowdspell.se, a free service that lets your visitors correct typos in your articles/pages by selecting the text. In fact, the service is active on this blog. Try selecting any text to try it out....…

Quick fix: IIS .woff font file 404 not found in asp.net mvc

This is just a very quick “bugfix” I found. When using Twitter Bootstrap Glyphicons the font comes in a lot of flavors, including .ttf and woff. Somehow it seems that IIS will return a 404 not found when requesting the .woff file – even though the file definitely exists and the URL is correct. The problem lies within the MIME-types that IIS use. …

Launching: TabsToSpaces.com. For your markdown code copy pastes

I’m launching a little tool that makes my life happier every time I use it. The problem I solve Okay. So I paste code from my IDE to my blog when showing code examples and snippets. In order for markdown to get the code block formation, this required 4 spaces in the beginning. Sometimes the code is intendented by tabs, sometimes not. But every time there are some rows that are not intendented at all (e.g. code at the base/root level scope). The solution I searched for an fast and easy online converter but there wasn’t any. No one covered...…