Category: Development

  • C# HtmlExtension to display SVGs

    You have SVGs that you wish to display on your website but you want to be able to re-use them without copying and pasting the code or creating a shared view.

    By creating an HtmlExtension class with a function called Svg you can create a centralized place to store and re-use your SVGs.

    (more…)

  • Cloning or Checking out a repository with GIT

    You have your own GIT repository or you wish to checkout a copy of a publicly or privately available repository to your computer.

    To checkout or as GIT calls it, clone, a repository the git clone command. This command accepts many different arguments. In your command line, type: git help clone for the full supported list.

    (more…)

  • JavaScript – Search a string for a substring

    You want to search a string variable to determine if it contains a matching substring value.

    To search for a string inside of a string contains several different methods, each offering their own benefit. The most common solutions involve the indexOf function or using a regular expression with the match function.

    (more…)

  • Set Cursor Position of textarea with JavaScript

    In the following example, I will create some basic functions to allow you to set where the cursor goes inside of a textarea or <input type=”text”>. Let’s dive right into the core JavaScript code that will leverage similar functions to a JavaScript array:

    (more…)

  • posh-git: the only GIT command line tool I use

    You’ve installed GitHub on Windows, but the UI sucks. So you want to use command line, but you want to easily know the state your changes are in at any given moment.

    The best command line tool that I use is posh-git. I use Windows for my local development which means I am using the Powershell version of posh-git.

    (more…)