A new domain. . .

I mapped my old domain name snowstormlife.com to the app service plan. So there’s another item for the TODO list once I get external storage set up:

– [] Copy all the blog posts from jimblizzard.wordpress.com over to snowstormlife.com.

Baby steps on the journey . . .

The site in it’s brand-new-baby form is alive and running in a Linux container-backed Azure website here. Again, just getting started with it, so nothing fancy at this point. I’ve learned a ton of stuff just getting this far — not just following some hands-on lab or quickstart tutorial, but having to look things up and try things out. Lots to blog about. I’ve been keeping a blog for forever on WordPress, but I’m going to use the new site to blog about this process.

Also, I used the Azure Portal’s DevOps Project feature to create the site with a docker container backing it, Azure Container Registry, an Azure DevOps CI/CD pipeline linked to this GitHub repo, etc. It took only 5 minutes to stand it up by answering 5 simple questions. (I’ll eventually put the blog in a Azure Kubernetes Service cluster, but I have a bit more learning / work to do so I don’t leave it hackable. ūüôā

Update 2020.05.11 – I’m not going to keep snowstormlife.cloud. I’m too cheap to pay that much every year. ūüôā I’ve decided to revive my old domain name snowstormlife.com. I also bought a custom domain name, Snowstormlife.cloud, where it lives. Current next steps are to create external storage for the blog so it doesn’t get blown away with each new container deployment. It’s currently using storage within the container, which isn’t good. As in, when I commit this change to master and the CI/CD pipeline runs, it’s going to blow away the container and anything I’ve posted on the site. ūüôā And I need to add an SSL cert to the site so it can do https…..

Snippets in VS Code

I just discovered how to create snippets for VS Code. All this time I’ve been living without them. Why didn’t I look into this before? I don’t know.

To create / edit snippets, in VS Code, press Ctrl+Shift+p then type “snip”

To edit your snippets, select Preferences: Configure User Snippets, then select the snippets file or create snippets

In WSL Ubuntu, my c# snippet config file is located here: /home/jim/csharp.json

Here’s an example of a couple that I created:

{

    // Place your snippets for csharp here. Each snippet is defined under a snippet name and has a prefix, body and 

    // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:

    // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 

    // same ids are connected.

    // Example:

¬†¬†¬†¬†//¬†“Print¬†to¬†console”:¬†{

¬†¬†¬†¬†//¬†¬†“prefix”:¬†“log”,

¬†¬†¬†¬†//¬†¬†“body”:¬†[

¬†¬†¬†¬†//¬†¬†¬†¬†¬†¬†“console.log(‘$1’);”,

¬†¬†¬†¬†//¬†¬†¬†¬†¬†¬†“$2”

    //  ],

¬†¬†¬†¬†//¬†¬†“description”:¬†“Log¬†output¬†to¬†console”

    // }

¬†¬†¬†¬†“Property”:¬†{

¬†¬†¬†¬†¬†¬†¬†¬†“prefix”:¬†“prop”,

¬†¬†¬†¬†¬†¬†¬†¬†“body”:¬†[

¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†“public¬†${1:type}¬†${2:MyProperty}¬†{get;¬†set;}”

        ],

¬†¬†¬†¬†¬†¬†¬†¬†“description”:¬†“Create¬†a¬†property¬†with¬†‘private¬†type¬†varName¬†{get;set;}'”

    }

¬†¬†¬†¬†“PropertyFull”:¬†{

¬†¬†¬†¬†¬†¬†¬†¬†“prefix”:¬†“propfull”,

¬†¬†¬†¬†¬†¬†¬†¬†“body”:¬†[

¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†“private¬†${1:type}¬†${2:myVar};”,

¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†“”,

¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†“public¬†$1¬†${3:MyProperty}”,

¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†“{“,

¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†”¬†¬†¬†get¬†{¬†return¬†$2;¬†}”,

¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†”¬†¬†¬†set¬†{¬†$2¬†=¬†value;¬†}”,

¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†“}”

        ],

¬†¬†¬†¬†¬†¬†¬†¬†“description”:¬†“Full¬†property¬†with¬†private¬†backing”

    }

}

After you save the file, in the VS Code editor for your C# project, simply type the snippet prefix, such as “prop” or “propfull” then press tab and fill in the values

 

Snippets are such handy things…..

 

There are a bunch of topic-specific config files available for use, too. For more info, see: https://code.visualstudio.com/docs/editor/userdefinedsnippets

 

Enjoy!

 

And don’t forget to wash your hands.

 

.