Normalized Attribute Names in Angular

I have been doing some hard directive/ html markup work and I came across a problem where I needed the normalized html tag attribute names.   (I was trying to create a html element but needed access to the normalized names without turning it into a directive) Angular.js normalizes names like “test-name” and “data-test-name” to…

Enabling MVC5 intellisense in a ClassLibrary Project

I’ve been searching and searching the internet for someone, somewhere who might know how to enable correct IntelliSense for cshtml (MVC 5.0) in VS2013 when developing in a ClassLibrary type project. This is the problem I was encountering: It’s all thanks to Mohammad Chehab, who was also stumped for a while (probably not as long as me),…

How to enable Typescript Compilation for a VS2013 Class Library Project

I know its a little obscure, but I recently needed to find out how to enable Typescript in a Visual Studio 2013 Class Library project, because per default this is not enabled. (probably a bug) Vanilla way of enabling TypeScript: Create a “Class Library” project Add a Typescript file (.ts) This is were the bug…

A Fluent Way of Exception Handling

While doing some filesystem work I encountered alot of AccessViolationExceptions because a file is being opened to write multiple times.  Even after closing the file explicitly a short timeframe exists in which the file could not be opened again.  The simplest approach for me was to retry openening the file until it worked.  To allow…

A Quick Way of Parsing versioned Web Asset Files

To parse versioned web asset filenames ala jquery-1.4.min.js I wrote a simple class /// <summary> /// simple class for describing a file library like  /// jquery-1.4.min.js /// bootstrap.min.css /// libname-1.0.0.0.tag1.tag2.tag3.extension /// … etc /// contains methods for parsing these kind of filenames /// </summary> public class FileLib {   /// <summary>   /// regular expression for parsing the filename   /// </summary>   public static readonly string libRegex = @”((?<libname>[^.-]*)-?)((?<major>d+))?(.(?<minor>d+)(.(?<revision>d+)(.(?<build>d+))?)?)?(.(?<tags>.+))*”;   /// <summary>   /// parses a path as a lib   /// </summary>   /// <param name=”path”></param>   /// <returns></returns>   public static FileLib ParsePath(string path)   {     var filename = Path.GetFileName(path);     return Parse(filename);   }   /// <summary>   /// parses a filename as a file lib    /// </summary>   /// <param name=”filename”></param>   /// <returns></returns>   public static FileLib Parse(string filename)   {     var match = Regex.Match(filename, libRegex);     match.NextMatch();     var lib = match.Groups[“libname”].Value ?? “”;     var major = match.Groups[“major”].Value ?? “”;     var minor = match.Groups[“minor”].Value ?? “”;     var revision = match.Groups[“revision”].Value ?? “”;     var build = match.Groups[“build”].Value ?? “”;     var tags = match.Groups[“tags”].Value.Split(‘.’);     var extension = tags.LastOrDefault() ?? “”;     tags = tags.Reverse().Skip(1).Reverse().ToArray();     var result = new FileLib()…