The Beard's Blog

Tales of a grumpy Software Engineer.

Read this first

ASP.NET Web API 2 - decoupling resource and authorization Web APIs.

TL;DR I wrote a small AngularJS app that consumes a resource and authorization Web APIs written in ASP.NET Web API 2/Katana using token based authentication. The SPA uses interceptors and request transformers to determine the authentication status and handle the authentication dance. Get a hold of the sources here

I had been playing around with ASP.NET Web API 2, Katana and Token Based Authentication specially around the idea of having multiple resource Web APIs and one Web API to handle authentication/authorization.

Also as part of the exercise, we’d have a Angular SPA to consume this, a pure static SPA as this would allow me to play also a little deeper with AngularJS’s components as interceptors and request transformers, details about both can be read here. Along the road I found a few issues I did not think of so I decided to document the whole thing here. The intention is not to...

Continue reading →

Puppet and custom Powershell Scripts.

TL;DR I had the need to run some custom PowerShell scripts to restart the the Websites and Application Pools in a Production Web Farm after successfully deploying the Web Application through Puppet; here is the Puppet Module and here the PowerShell Script.

So, I had the need to run some custom PowerShell scripts after successfully deploying our .NET Web Application packages to our Web Server Farm, right now the Puppet Modules tell the nodes to deploy the Web Deployment Package generated by TFS after creating the Web Sites, Application Pools and enforcing settings if needed, just as a little background, we are using Spring.NET caching abstractions with the ASP.NET Cache so our intention is that as part of the deployment process we just flush both our Web Tier and App Tier caches.

We developed a couple of PowerShell scripts, one to restart the Web site and Application Pools of the...

Continue reading →

Fighting my monsters, exercise

40ish days ago I made one of the most important and most difficult decisions in my life, at least that’s how it looked that day, today I just look back and say, “you fucking idiot, you should have done it earlier” but sometimes we just need a little push to kick some things off.

For 12 years or so I had been, if I might say, inactive when it comes to sports or exercise, I just did not feel like doing it and even though I had people that encouraged me to do it, I just never thought things through as I do now I guess or I just care more now.

I am determined person, goal oriented, I gotta get things done and done right, whenever I feel I get to a comfort zone I just try to find the next challenge; I am curious and always look forward to learn new stuff. So one day I thought why I had never been this way with my health and being active? this was one contributing fact and another that I...

Continue reading →

ASP.NET - MVC4 Web Optimizations in a MVC3 Web Application.

TL;DR The article describes how to use the Web Optimizations library available in MVC4 in a MVC3 Project based on ASP.NET Forms View engine and uses a custom XML Source to define the Application bundles, Sample Project is available here

As good Software Developers we always want to do things the right way, although “The Right Way” is subject to how much time we have to actually do it.

Where I work we have an Web Application we had migrated from MVC2 to MVC3, yes you might be thinking it is old… I agree, but it is what it is, as I said we are not alway allowed to set ourselves free and do whatever we want, specially when we have our own little wishlist of stuff we desire to do. Anyways, as all Web Applications, this one had its own way to Compress and Version static resources as JavaScript files and Stylesheets, it was a not-perfect-still-decent-an-functional homemade implementation.


Continue reading →

Good commits

There I was the other day before going to bed scrolling through some unread articles, I tend to see the article headings and immediately send it to pocket for later reading, and found this article entitled What’s in a good Commit TL;DR the article is about what a good practice is when it comes to committing changes to a source control system, Why should you do it some way or another and the benefits for it and well it also mentions some bad scenarios when a bad approach is taken.

It kind of got me, I use Git and love it but unfortunately I do not use it on my day Job there we use TFS and always are very close of screaming in agony when using it, I don’t even let it merge the changes, I prefer to do that myself, it is safer and committing… well whatever you put there immediately affects the current code base, you can use shelvesets of course to get around this though, but they are not...

Continue reading →

ExtJS accessing IFrame content from parent and viceversa

For those who have worked with ExtJS or Ext.NET you have had the need to interact with IFrames.

This post does not intend to explain ExtJS/Ext.NET, However it is worth explaining for the sake of this post that IFrames are usually found when we load one of our pages in a Ext Panel through the autoLoad property, now, autoLoad has two modes, IFrame or Merge, while merge takes the content of the view to load and inserts all elements in the caller panel, thus, making these elements part of the Panel DOM itself whereas IFrame uses a HTML IFrame element to load the desired page, by default ExtJS will default to merge.

 So, the problem:

So by having our view boxed in the IFrame we cannot reference elements by ID or name since they are not part of the current DOM, so we need to access the loaded page elements through the IFrame.


The IFrame will have its own window and document...

Continue reading →