Expand Nested Bash Variables

You’ve evaluated normal Bash variables, but what do you do when the value of your bash variable is another variable?


Asciidoctor: Placing Images Within Lists

A nice little feature that isn’t made quite clear in Asciidoctor’s nice and comprehensive user manual is the ability to place images in the middle of lists. Lists Asciidoctor lists can be either ordered or unordered and are created like so: And Images Asciidoctor images can be added using the macro: Why Not Both? Trying… Continue reading Asciidoctor: Placing Images Within Lists

Disable the Optimus discrete graphics GPU in Ubuntu using bbswitch

I’ve recently made the mistake of purchasing the Asus K56VM laptop. I call this purchase a mistake because as well as an excellent spec (3rd gen. i7 processor, excellent screen), this laptop also comes with nvidia’s Optimus graphic card setup. In case you’re not familiar with the Optimus setup, it basically means that your laptop… Continue reading Disable the Optimus discrete graphics GPU in Ubuntu using bbswitch

Validating MongoDB’s DBRefs

As discussed on this SO question. Ref Marks The Spot For various reasons MongoDB doesn’t support joins, but documents can be linked using DBRefs. For example, we’d like to build a relation between space ships and crew members. Our ships document looks like: And our crew document looks like: We link Capt. Mal to his… Continue reading Validating MongoDB’s DBRefs

Setup Once Per Feature With Spock Extensions

Disclaimer: This example is a hack that uses un-official/non-public Spock APIs. A proper implementation of this extensions is also included and distributed as part of my Spock Extensions module; The library can be downloaded from here and is also hosted on github. Also, as seen on Stephen Chin’s Nighthacker 🙂 The Missing pieces Prior to… Continue reading Setup Once Per Feature With Spock Extensions