Skip to content

Instantly share code, notes, and snippets.

@richrout
richrout / pre-commit
Created August 11, 2017 14:01
Git pre-commit hook to run tslint on modified files only
#!/bin/sh
git diff --cached --name-only | egrep ".*\.tsx?" | xargs -r tslint
@richrout
richrout / TestBundleConfig.cs
Created October 7, 2016 14:22
Testing ASP.NET MVC BundleConfig with VirtualPathProvider
public class TestVirtualPathProvider : VirtualPathProvider
{
private string NormalizeVirtualPath(string virtualPath, bool isDirectory = false)
{
if (!virtualPath.StartsWith("~"))
{
virtualPath = "~" + virtualPath;
}
virtualPath = virtualPath.Replace('\\', '/');
// Normalize directories to always have an ending "/"