Octopus Deploy is a great tool for doing release management for .NET platforms. If you’re doing any kind of .NET-apps I really recommend you do try it out. Lately I’ve been using it at work for deployments to Azure Cloud Services. Octopus handles both deploying your app to your server, but also setting the correct configuration parameters for the environment you are deploying to. In Azure Cloud Services the relevant config file is by default ServiceConfiguration.Cloud.cscfg
as well as the usual web.config.
JavaScript Arrays: Truth or Dare
Okay, I kind of like this one.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Another way of showing the relationship between empty arrays and true/truthy values:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Empty arrays boolean evaluation summarized:
truthy
when by itself (when not compared to a bool)false
when compared to a bool using the==
operator. JavaScript coerces the empty array to it’s boolean equivalent, which is what happens when we compare using the==
operator.- NEVER true when compared to either
true
norfalse
using the value and type comparison :===
.
Funny side note:
1
|
|
The right side ![]
converts the array to a boolean true
and flips it to false
. Then the ==
operator, since the types are different, converts the left side to a primitive value (by calling [].valueOf()
) and ultimately ends up with 0. The right side false
also gets converted to a zero, so in the end they compare equal.
…
Puh.
JavaScript and the ‘This’ Keyword
I just started reading Christian Johansen’s book ‘Test Driven JavaScript Development’, and read a little snippet I found rather interesting about the ‘this’ keyword and it’s behaviour depending on execution context. Let’s see a small example :
1 2 3 4 5 6 |
|
Sublime Text 2 and Jade Highlighting
Since Sublime Text 2 does not support Jade syntax highlighting out of the box, you have to add the feature yourself. Adding Jade support is easy though. I found the following tip on StackOverflow. Sublime Text 2 supports the same format as TextMate when it comes to syntax definition files. First, navigate to the Sublime Text Packages folder, on OSX found at
1
|
|
Create a folder called Jade
. Now download the syntax files into this folder, either by using Curl or just directly. One example is found here.
Downloading using Curl:
1
|
|
Re-open any open Jade file in Sublime Text 2, and there you go. Quite easy.
Useful Octopress Commands
GitHub Pages is awesome. Octopress makes it even MORE awesome.
A small list of useful commands for making blog posts using Octopress.