2017-07-18

Keeping AzureRM PowerShell cmdlets up to date


Microsoft has been updating the AzureRM PowerShell cmdlets on a nearly monthly basis. To keep them up to date on your PC uninstall the old version(s) then install the newest version.
First, open PowerShell as an Administrator.

Image showing 'Run as Administrator'
Uninstall old verion(s):
Get-InstalledModule -Name "AzureRM" -AllVersions | Uninstall-Module

In the command above we first find all installed versions of the AzureRM cmdlets, then pipe that into Uninstall-Module to remove the module. Install newest module:
Install-Module -Name "AzureRM"

If you get the warning message:
Untrusted repository You are installing the modules from an untrusted repository. If you trust this reposito InstallationPolicy value by running the Set-PSRepository cmdlet. Are y
ou sure you want 'PSGallery'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
You can prevent this in the future by running:
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

2015-06-03

FullCalendar.js, Change Event Title on events load

While working on a new project for $WORK, I had the opportunity to use the FullCalendar.js library, which is a very good attempt at re-creating Google Calendar for us mere mortals.

One of the tasks I wanted to accomplish was to append an object property to the event.title, but not actually change that event title (E.g., event.title = "Test Title", event.custom_property = "tylerdurden1". Title should read "Test Title (tylerdurden1)".).

To accomplish this:


Full initialization:

2015-02-27

jQuery: Counting the number of matching class elements on the page

While working on a project I hacked some code together to count the number of flagged questions in an exam. My initial code, which is bad and poorly optimized as seen here: While here I have my optimized code: Not only is the optimized code smaller (nearly half as many lines and its also much easier to read.

2015-01-08

jQuery: Hot Keys!

A while ago we added a button on one of our pages that takes you to the next logical place on the page. This button over time has moved and is far from the inputs it needs to take you to.  The next logical enhancement for this button was to make it a hot key as well, so that is what I've done.

In addition to jQuery, which is already loaded on our pages we've added a small-ish (4.52KB, 1.95KB minified) library called, jquery.hotkeys.js.  With a couple of lines I was able to add in a simple hot key combo that also takes you to the same logical spot on the page.  This allows our users to keep their hands on the keyboard for better efficiency.

Example:

2015-01-06

jQuery: Finding the first input with a class

Just a quick little snippet for finding the first input on the page with a specific class.

2014-06-10

Converting Bytes to human readable Perl function

I'm sure this is covered by a Perl Module some where, but I haven't gone looking.  Instead I've written and the re-written a function that will convert a raw number of bytes to something more human friendly.

Below you can see the two subroutines I've written over time.
The old one only went up to Petabyte (which is already larger than we will accept for a file).  While usable it just seems clunky compared to the new function.

2014-04-29

jQuery adding options to a select list

From time to time I find myself searching for the same solution to something I know I've already done.  This is one of those things.  I needed to add options to a select list with jQuery.

In the code below lines one and four are the old manual way I did things.  If I needed the value or the text of the option to be a JavaScript variable, I had to start concatenating the strings.  This is a bit easier with lines two and five.

Also note, in the programmatic way if you need to insert HTML entities you have to use the html function instead of the text function.