How I concatenate header, footer for html web development using gulp

I often like to start new sites with a mock up that is strictly html. I get html templates from sites like Theme Forest so they are already designed for me. All I do is modify it to fit the theme of my new site.

The biggest pain is that most of these html files have the header and footer in them so looking at the files one at a time look great but when I want to start my modifications, I’m looking for a way to make a change in the header or footer section once and then see it in all of my new pages.

Here’s what I’m doing to get this done today, it’s simple, easy to implement and trimmed down to just the basics to get going. I really love gulp and doing html mockups in real-time is a dream come true.

Continue reading “How I concatenate header, footer for html web development using gulp”

(solved for now) Export Template in Visual Studio 2017

If you’re like me, you like to create templates out of your Visual Studio 2017 code so you can just use those templates as your base for starting all new projects.

The reason I do this is so I don’t have to start over from scratch. If you’re doing that all the time, you are re-inventing the wheel and wasting precious cycles of your life.

Using export template in Visual Studio 2017 is amazing but as of Fall 2017, it’s broken.

export template fix for visual studio 2017
export template fix for visual studio 2017

Continue reading “(solved for now) Export Template in Visual Studio 2017”

Uppercase First Method in C#

C# method to uppercase the first letter of a passed in string.

I know that this method is out on the interwebs somewhere so if anyone knows, please share with me so I can give credit where credit is due.

I am starting to share all of my little helper methods online so I never forget 🙂

private static string UppercaseFirst(string s)
{
	// Check for empty string.
	if (string.IsNullOrEmpty(s))
	{
		return string.Empty;
	}
	// Return char and concat substring.
	return char.ToUpper(s[0]) + s.Substring(1);
}

How to delete the IIS ASP.NET response headers for security sake

There are some nice plugins out there like “BuiltWith” and “Web Server Notifier” and many others that allow you to see the platform that websites run on.

These tools will show what server you’re using like Apache, IIS, Nginix etc. and your security people in your company will ask you to turn off the sharing of this information.

Here’s what I do to remove that information and I use IIS so I add this section to my web config.

<system.webServer>
    <httpProtocol>
        <customHeaders>
            <remove name="X-Powered-By" />
            <remove name="X-AspNet-Version" />
            <remove name="Server" />
        </customHeaders>
    </httpProtocol>
</system.webServer>