Posts

Don't Get Skewered By "kebab-case" In Aurelia

This is one of those daily occurences I see in the official Aurelia Gitter chatroom (not a member, come say hello here). You are using a bindable in your application to add in binding, whether it be one-way, two-way or one-time. You might define your bindable inside of your custom element viewmodel like this: import {bindable} from 'aurelia-framework'; export class MyNameCustomElement { @bindable someNameValue = ''; } One would naturally assume that to use this attribute, you would reference it like this:

Working With Aurelia @observable

Even if you are new to Aurelia, you are probably familiar with the @bindable functionality which allows you to add bindable attributes primarily to your custom elements and custom attributes. There is a lesser known feature in Aurelia in the form of @observable which allows you to use the underlying observation layer in Aurelia to observe variables for changes and react accordingly in a similar way you react to changes on @bindable attributes.

String Enums In TypeScript

Sometimes you want to specify in your application multiple allowed values. For example, you might have a method which allows you to perform server requests and the only allowed values are; GET, POST, UPDATE, DELETE and PUT. Ideally you want to prevent any developer from calling a method with an invalid value. Normally you would use an enum for this, most languages support the use of an enum which might be used for this purpose.

Thrice – The Artist In The Ambulance (Instrumental Tracks)

Quite a while back I posted a rare find that I got off of Amazon: an instrumental copy of Thrice’s seminal release The Artist In The Ambulance. Well, I finally got around to posting it up on Youtube for your enjoyment here. Make sure you watch in 1080p for better sound quality.

Removing Items From An Array In Javascript (by index)

It is that time of the week for Obvious Javascript Tip of the week. You probably already know how to delete an item from an array, maybe not. Sometimes it can be confusing, do I use the delete keyword, do I use slice or do I use splice? Splice of life Using splice we can remove items from an array by providing the index (with the first item being zero).

Removing A Character From The Start/End of a String In Javascript

Show of hands if you can off of the top of your head remove/trim a character from the start or end of a string. If your hand remained down, don’t feel too bad. There are so many string manipulation methods in Javascript, it can be confusing. We have; substr, substring and splice (just off the top of my head). Not many people can tell you the differences between the three without Googling.

Removing Duplicate Objects From An Array By Property Name In Javascript

If you have an array of objects and you want to filter the array to remove duplicate objects but do so based on a provided key/property, this might prove to be a problem you would expect Javascript to address natively. If you are using Lodash then you have many methods at your disposal that can help. Fortunately, if you are working with ES6 and up, writing some basic Javascript using the filter and map functions makes this possible.

Naturally Cooling Your Wort

When it comes to brewing, besides perfect sanitisation the other deciding factor is temperature. If your equipment is sanitised correctly, from the pot you boil in to the spoon you stir the mixture with the only thing you have to contend with is the temperature of your wort (especially during the initial fermentation stage). Depending on the style of beer you are making, your temperature will vary. One of the biggest problems I have as a homebrewer is cooling down the hot wort mixture before pitching my yeast.

Stan (the not quite Netflix competitor) Is Horrible

Shame on you Stan, shame on you Australia. In the video streaming wars you have the king sitting on the iron throne: Netflix and then you have everyone else fighting for their chance to sit on the throne. In Australia we have Netflix, we have Presto, we have Foxtel, Foxtel Go and we have Stan. I have been a subscriber to Netflix since it launched, I tried Presto and found it to be too expensive, Foxtel is a relic of the past and Stan is somewhere in between.

Equal Height Grid Columns with Padding Using Flexbox

Without-a-doubt layout in any modern website or application is one of the most challenging parts, especially when you want it to work on both desktop and small handheld devices like iPhone’s. For a project I am working on, I have been extensively using Flexbox for the layout where applicable. One such layout is a grid of blog posts at the bottom of each page for clickthrough. These items have varied length post titles and imagery. It only takes one title to be shorter than the others and float:left and display:inline-block solutions fall apart.