Cheatsheet and best practices for Git

Git-Logo-2Color

Git is distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is a primary tool for both developers and cloud engineers who are moving to infrastructure as code. Git is the core of a modern version control software, which keeps track of every modification to the code in a special kind of database. If (dare I say “when”) a mistake is made, you can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members.

You do not need to have your repository set up to get started with Git. Although you will want to set one up to save your changes and to manage your deployments. Learn more about how to set up your repositories in the previous post.

In this article, you will find a list of resources to use to learn how to get started with Git.  The article provides some sample command in a pattern you will use for your code or your infrastructure as a code. There are also references on how to get started learning Git.

Or .. if you prefer you can use the Git Cheatsheet from GitHub. The contribution made in this blog post is to show you common patterns you will use daily.

Continue reading “Cheatsheet and best practices for Git”

Set up Git with repository on GitHub or Azure DevOps Repos

github
In setting up our production environments, we’re started to get some code that we will want to backup, save, reuse, make changes, and share with others. We will want collaborate. And a source control system is idea for all this.

Git is distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is a primary tool for both developers and cloud engineers who are moving to infrastructure as code. In our next post you will learn more about Git workflows. But first, because our blog is related to enterprise production, you will you will want to set up a repository for your code.

The purpose of this article is to provide the steps to get set up and provide the steps for some common scenarios for both GitHub and Azure DevOps so you can get started checking in code.
Continue reading “Set up Git with repository on GitHub or Azure DevOps Repos”

Understanding Azure Policy for regulatory compliance

azpolicyUse Azure Policy to manage and enforce your standards for governance and compliance and to assess that compliance at scale. The idea is to set standards and to be able to demonstrated your organization is meeting your regularoty compliance goals.

In previous blog posts, you learned about setting up Management Groups and Security Center. For management groups, you learned that policies can be applied  across multiple subscriptions. You noticed that Security Center provides a set of policies (an an policy initiative) for your subscription.

In this post, learn the basics of Azure Policy for you to manage resource consistency, regulatory compliance, security, and cost. And how Policies can be grouped together as initiatives, and how you can assign initiatives to specific regulatory compliance goals.

Continue reading “Understanding Azure Policy for regulatory compliance”

Checklist of Azure tools for enterprise admin: PowerShell, AzCopy, Azure CLI, Docker, Git, Azure Providers

powershellAzure provides the Azure Cloud Shell which includes almost every tool you will need already installed. But that requires you to be logged into the portal. And it times out after a short time. So you can administer Azure from your desktop.

There are tools you will normally want on your local computer to administer Azure:

  • PowerShell
  • Azure Powershell
  • Azure CLI and some additional tools (such as jq and Kubernetes)
  • AzCopy
  • Git
  • Docker
  • Visual Studio Code and extensions

All are cross platform tools. In this article, you will learn how to install the tools from the command line. And you will learn about Azure providers and how to add them to your subscription.

Continue reading “Checklist of Azure tools for enterprise admin: PowerShell, AzCopy, Azure CLI, Docker, Git, Azure Providers”

Object JavaScript – Building Stateful jQuery UI Plugin Using Widget Factory

imageIn this post, you will learn step-by-step to build your own custom, reusable, testable jQuery UI widget.

You will extend the jQuery library with custom UI code and then use it on a page. The initial plug-in will be trivial to demonstrate the jQuery Widget Factory pattern. You will provide properties that you can change to change the look of your widget and you will provide some methods that will respond to user input.

In this post example, you will learn how to create a simple click counter. Click a button, increase the count. The idea is to show you the steps to create a jQuery UI Widget.

The Widget Factory system manages state, allows multiple functions to be exposed via a single plugin, and provides various extension points.

Continue reading “Object JavaScript – Building Stateful jQuery UI Plugin Using Widget Factory”

Object JavaScript – Building a Reusable Stateless jQuery Plugin

6327_image_58FAEDFAIn this post, you will learn step-by-step to build your own custom, reusable, testable jQuery Plugin.

There are times where you will want to reuse code that performs a series of operations on a selection.

For example, you may want to embed information a span element and then have that information displayed in a references section near the end of the document. In this case, the jQuery plugin is stateless.

In the next post, Building Stateful jQuery UI Plugin Using Widget Factory, you will see how to create a stateful jQuery plugin using jQuery Widget. And you will see how the widget is a better solution for plugins that require user interaction, because the Widget factory helps you maintain state.

Continue reading “Object JavaScript – Building a Reusable Stateless jQuery Plugin”

Snippet – What to Do About Old Browsers

image_thumb_7F533839Web sites reflect the company’s professional image. If your site renders improperly or not at all, your company’s reputation can be tarnished. If your site has browser display problems, visitors and potential customers will leave your site and not look back.

In the post Using Modernizr, Polyfills, YepNope, you learned how you can support browsers that might not have the capabilities that you need. But at some point you may not be able to support really old browsers. At that point, you may just want to recommend the user update. Even for enterprise apps, you will want to remind users to use a current browser rather than have your app fail because your app is expecting something that does not exist.>p>You can use the following code to help your users get up to date browsers. Continue reading “Snippet – What to Do About Old Browsers”

Snippet – Checking Internet Connection, No More Hanging App

Messaging-Online-iconWhen you are writing your single page application (SPA) may find that you need to check your connection. The idea is that you might have one set of logic for your connected app and another for when you are disconnected.

In previous posts, AppCache for Offline Apps and Loading, Caching LoDash or Underscore Templates Using RequireJS, AppCache, you learned that your Web app did not have to be online to be run. In fact, when building HTML apps for mobile devices, you are running without a connection.

So how do you check? How do you know when you can upload and download new information from the Web?

Many of the comments on StackOverflow have to do with the connection hanging. The following snippets help you work around the issue.

Continue reading “Snippet – Checking Internet Connection, No More Hanging App”

Tip – Serving .json File on Windows (IIS, IIS Express)

imageSo what is wrong with the simple getJSON call? Why doesn’t it work?

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
  $(document).ready(function(){
     $.getJSON('data.json',function(result){
      alert("success");
    });
  });

It works fine in Firefox 11 but not in IE and Chrome. By default, IIS6 does not serve .json (no wildcard MIME type). So you will see a 404 not found thrown.

By default, IIS in Windows Server 2003 and beyond does not serve files that aren’t of a MIME type that it knows about (instead returning 404 errors).

So, to serve up JSON files you need to add a MIME type to IIS to allow it to serve that type of file. You can set it at the site level or at the server level.

Continue reading “Tip – Serving .json File on Windows (IIS, IIS Express)”

Snippet – Using FontAwesome, Bootstrap, MVC for Checkbox, Radio Controls

imageSo how can you use the check-boxes from Font Awesome, and get the box to check/uncheck. When a user clicks, how do I show the right icon?

When checked: icon-check ; unchecked: icon-check-empty.

The basic idea is to select spans:before that is next to input you want..

image 

image

If you are using less/sass, you could just include the .icon-glass:before declarations, to make it all easier to maintain & modify. Continue reading “Snippet – Using FontAwesome, Bootstrap, MVC for Checkbox, Radio Controls”