Justin Walker

WEB DEVELOPER, CAT ENTHUSIAST, FAN OF VINTAGE COCKTAILS, TRAVEL, AND BREAKFAST BURRITOS

C# - String to Title Case

I was recently given a bunch of data to import where the names of businesses where all capitalized and I needed to store them in title case. TextInfo has a ToTitleCase method but it does not account for special characters (e.g. “O’BRIAN” or “BEST-COFFEE”).I ended up writing a string extention method where I first run ToTitleCase then apply regex to look for letters following special characters....

Simple forms authentication for Azure Websites

I needed a way to password-protect a staged version of a project I was working on that was up on azure websites. Normally I would use an .htpasswd but that doesn’t work on IIS. I found gist that someone had put together that was using forms authentication and I made it all bootstrappy.Just place both files in the root of your project.

CSS - Full Page Fixed Background on iOS

I struggled for a bit trying to get this to work on iOS. I had a background set to cover on the HTML element and on a desktop browser it worked great. The issue with iOS (and other touch screen devices) is that the background did not stay fixed and was also stretched to the total height of the content (not the viewport).This was the solution I came up with that worked:html { background: url('pa...

Edit JS And CSS Without Rebuild In Visual Studio

I came across an issue when starting a new project in Visual Studio where I would edit a CSS, JS, or razor view file and in order to view the changes in the browser I had to rebuild the entire project. By default Visual Studio should be aware of the change and you should be able to refresh the browser sans-rebuild. It had worked before, but for new projects was an issue.TL;DRWhen developing in ...

Access IIS Localhost From Another Computer

UPDATE 2019-01-26The steps below probably still work, but since then I’ve been using ngrok. Much easier!I regularly need to test a website I’m working on in another browser or on another device, like an iPad or an iPhone. When running an apache server in OS X you can you simply point your mobile device to your Mac’s IP address. If you’re developing in Visual Studio and using IIS you will need t...