Create a Development Version of an Existing WordPress Site

UPDATE : This article provides a manual approach to creating a development copy of your website. However, I ran across this WPBeginner article which describes a much easier approach using the Duplicator plugin. I would suggest following that guide unless you prefer the manual process. Before We Start Here’s my environment setup. This post should still be helpful if your setup isn’t exactly the same, though. GoDaddy Hosting (production) WAMP (development) phpMyAdmin (production + development) Files Download WordPress Files Instead of using the WordPress export feature, we’re going to grab all site’s files....

January 12, 2014

HTML5 Articles and Sections

Having trouble deciding whether to use a div, section or article in your HTML5 page? Oli Studholme has a great article explaining how they should be used and provides a very simple method for deciding which to use. To decide which of these three elements is appropriate, choose the first suitable option: 1. Would the enclosed content would make sense on it’s own in a feed reader? If so use 2....

December 27, 2013

Force Bundling Optimizations

Use the following code in the BundleConfig.cs of your ASP.NET MVC application to force bundling and minification. // BundleConfig::RegisterBundles BundleTable.EnableOptimizations = true; Why? Why would you do this? Sometimes bundling and minification causes problems, such as in AngularJS. You will want to find these problems before publishing, so just enable this line every once in a while to make sure everything still works as expected with the optimizations.

December 16, 2013

Read Open File in C#

This post is a summary of this StackOverflow answer by Cheeso. To read a file that is currently open (or may be open later) in another process, you must specify a FileShare option. The FileShare flag indicates the modes that other processes are allowed to open the file in. using (Stream s = System.IO.File.Open(fullFilePath, FileMode.Open, FileAccess.Read, // I want to open this file for reading only. FileShare.ReadWrite)) // Other processes may specify // FileAccess of read or write....

December 16, 2013

Email Addresses as User Names in ASP.NET Identity

It’s common for web applications to use email addresses instead of user names to distinguish users. However, if you are using ASP.NET Identity, you have probably noticed that it has UserName built into the IUser interface. Since Identity assumes that this is the distinguishing field for the user, it’s not crazy to think that it might be a good place to drop the email address. In order to have Identity allow an email address in this field, you will need to write a custom IIdentityValidator....

November 10, 2013