Posts

Code Syntax Highlighting

Image
Code Syntax Highlighting If you have a site which has code snippets, you probably want to implement code syntax highlighting. How do you implement syntax highlighting? You can easily implement a solution in a few minutes using hightlight.js . Within your HTML page(s) head tag, you will need to add the below three lines of code. The three lines of code import the required css, import the required JavaScript functions and initializes the JavaScript object. <!-- Syntax Highlighting --> <link href='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/default.min.css' rel='stylesheet'/> <script src='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js'/> <script>hljs.initHighlightingOnLoad();</script> If you are using a tool like Blogger or WordPress you will need to add the three lines of code to your template. In Blogger it should look something like this: After you implement the previous three lines...

PowerShell Unzip File

PowerShell Unzip File OK, I seem to run into this every now and then, so I decided to write it down so I don't forget it. If you need to extract a zip file in PowerShell use the following: Expand-Archive -Path "nugetPackage.zip" "z:\Temp\nugetPackage" You can make this a function, but that seems a little redundant, since it's already a function: function UnzipFile {     param([string] $source, [string] $destination)     Expand-Archive -Path "$source" "$destination" } And you can call the new function like this: UnzipFile "nugetPackage.zip" "z:\Temp\nugetPackage" You might get unsupported archive file type, so you can always rename the file to .zip to get around this; assuming the file is in zip format, but has a different file extension. This happens with .xap, .jar, .nupkg, etc... mv nugetPackage.nupkg nugetPackage.zip Expand-Archive -Path "nugetPackage.zip" "z:\Temp\nugetPackage...

The Goal

The Goal I wanted to start a blog to discuss tools, processes and techniques for automation. I hope that all my topics will work together to help you build an automated system. What is automation? According to dictionary.com automation is: the technique, method, or system of operating or controlling a process by highly automatic means, as by electronic devices, reducing human intervention to a minimum. What does this mean to me? To me, automation is anything that allows us to do something faster in a more automated fashion. In my definition, automation is anything that helps us accomplish less input, provides more consistency and produces more reliability. Automation should have freed us from a portion or all of a task, so we can concentrate our efforts elsewhere. I like a more vague definition: as we can start out by creating easy scripts, that can eventually lead to a textbook version of automation. It is also common to use over engineered programs, when simple process...