Barbarian Meets Coding Titlebarbarianmeetscoding

WebDev, UX & a Pinch of Fantasy

1 minute readbarbaric-tip-of-the-week

Barbaric Tip of the Week: REST happily with Postman

Barbaric Tip of the Week is a weekly series whose main purpose is to share tiny bits of knowledge that I find specially useful and interesting.

Hi hi! This week’s Barbaric Tip is about a great HTTP client I just found out about (thanks good folk of Experion). Postman will let you easily test any HTTP based API directly from you Chrome browser and:

  • Build HTTP request to your heart’s content
  • Save and categorize requests for later use
  • Setup different environments
  • Setup different types of authentication
A screenshot testing postman with the NASA APIs

My very favorite tool for working with HTTP requests is fiddler, but I really miss it when I am working on my mac, so I will definitely add this to my arsenal going forward.

3 minutes readarticles

What is New in Knockout.js 3.0 Lightning Round

I have been writing so much about Knockout.js lately that I thought it would be a disservice not to write about the release of its latest version, Knockout.js 3.0. I will write a lightning version, a fast and brief summary if you will, as better in-depth blog posts have already been written (see links below :) ). Without further ado, this is what is new in Knockout.js 3.0:

  1. Multiple bindings that affect the same element are evaluated independently, that is, changes in an observable no longer trigger updates in bindings that do not directly depend on it.
  2. Ordered bindings. The execution of some bindings is now done in a particular order to avoid WTF bugs. For instance, the binding value: selectedValue, options: choices would not work in Knockout 2.3, and debugging it would be a pain. This feature works for all built-in bindings and can be defined for custom bindings.
  3. You can now add an arbitrary pre-processing function to built-in and custom bindings. This function will be given the unadultered binding value before it is evaluated.
  4. Likewise, you can now add a node pre-processing function to the binding provider that will be executed for each node within the document before it is processed for bindings. (This is used in knockout punches to add support for handlerbars syntax).
  5. Knockout now supports dynamic binding handlers. You can override the new ko.getBindingHandler function that determines which binding handler to use and add bindings on the fly.
  6. New checkedValue binding that extends the functionality in the checked binding to support objects (the latter did only support the input’s value property, that is a primitive)
  7. An experimental version of observable view models, that is, switch the entire view model and update each individual binding separatel.
  8. The options binding now generates a change event, if changed (as when we remove the selected item), it will trigger updates in other bindings such as value or selectedOption.
  9. New arrayChange event that makes it super easy to figure out has an observable array has changed.
  10. Support for binding to detached nodes
  11. Support for arrays of observables in addition to observable arrays.
  12. The optionsCaption binding is now HTML encoded.
  13. Is fully (very) backward compatible

In summary, new and awesome extensibility points, performance improvements and minor yet nice bug fixes and usability improvements.

Note that much better blog posts by most experienced people have been written about this new version, so, if you have some more time to spare, please check Steven Sanderson’s Knockout.js 3.0 RC and Knockout.js 3.0 Beta blog posts and Ryan P. Niemeyer’s blog for more in-depth information and a very good screencast.

12 minutes readarticles

Barbarian Meets Knockout: Knockout.js Computed Observables

The “barbarian meets” series are a collection of articles that intend to introduce and explain useful libraries, frameworks, tools and technologies in simple and straightforward terms. These new series will focus on Knockout.js, the popular JavaScript MVVM library

Hi everyone! Time to continue learning knockout.js! This time I will write about computed observables, a special kind of Knockout.js Observables that allow you to calculate values in the client from other properties of your view model with one nifty special feature: A computed observable will listen for changes in the observables it depends of and recalculate its value when these observables change.

Read on →
2 minutes readbarbaric-monthly-october-2013

Barbaric October: Writing an iOS Game With SpriteKit

Barbaric Monthly is my attempt at building/improving a coding project per month so that I can experiment with old and new technologies, learn ad infinitum, remain excited about the craft and nurture my passion for software development. This Barbaric Monthly is about practicing Objective-C and iOS development building a game using SpriteKit.

Hello people! Time for some coding fun XD

Taking advantage of the fact that I am going to be coordinating the development of an iOS app at Medius, I decided that it was the perfect time to learn me some Objective-C and iOS development. So after looking at some courses at Pluralsight and the CodeSchool, I think I am going to build something to imprint all these fleeting knowledge in my head and typing muscles, before it vanishes for ever.

The idea is to build a game and an app and publish them in the App Store before the end of the year (good luck dude XD). I am going to start with the game and use SpriteKit, a brand new game development framework released with iOS7 that comes with all the goodies one needs to build a 2D game: asset management, physics and particle engines, etc.

After doing some short brainstorming (and feeling inspired by the Jumping Into SpriteKit tutorial) I have decided to go with the cute-human-like-space-ship-stranded-in-the-void-searches-for-home-and-finds-earth-that-was-turned-to-cinders theme. Here is some concept art:

Concept art for iOS SpriteKit game

The game dynamics will be based on some sort of free-exploratory-space-shooter of sorts. Check the first ever screenshot of the game (and be merciful):

iOs SpriteKit game screenshot

Ok, let’s get to it, wish me luck :)

P.S. for the people at work: Yes… I know you people from work feel sad that I have abandoned the Cat-Zez game xD but be patient xD I will write that Cat-astrophic game in the future, as my second iOS game ;)

3 minutes readresources

Some great resources to begin learning node.js

For a while now I have had one eye on node.js, looking in the distance and oftentimes thinking hmm… it would be cool to find some time to take a look at that technology :)… but never actually doing anything at all. A couple of months ago however, and with the excuse of participating in east sweden hack, I found the perfect opportunity to start dabbling in node. (yey! ftw!)

After some experience with node, and with the fresh eyes of a newbie that hasn’t yet bumped into those painful areas that every technology has, I must say I love it. I love the vim/cli combo, the speed (or perceived speed) of development, the culture of automation and the rich library ecosystem. So much so, that I am looking forward to continue learning node and will definitely use it in my upcoming side projects.

Ok, to the meat of the blog post. Here are some of the resources I used to learn what little I know about node.js.

  • Real Time Web with node.js at CodeSchool provides the easiest and most straightforward way to start learning node since you don’t need to install any tooling. As usual, they provide a friction free, interactive learning experience where you just need to watch a series of videos and complete the different challenges in their web-based editors. This course is probably your best bet as a beginner in node.js.

  • Introduction to node.js at Pluralsight covers more or less the same content as the previous course, but with an awesome addition: all course demos are shown using the awesome Cloud 9 IDE. This means that, with this course you are going to get more of a taste of how to develop real node applications feels like, but still without actually needing to install anything on your machine.

  • Web Development with ExpressJS at Pluralsight provides an introduction to developing web applications with the Express.js framework using the Jade template engine, the Stylus css preprocessor and JetBrains WebStorm as IDE. Probably the most practical course of these last three.

  • Let’s code Test-Driven JavaScript was a great surprise. Being the fan of TDD that I am, it was great to find a reference of this discipline in JavaScript, since it has been giving me some headaches when coming from TDDing in C#.

  • Yeoman is not a resource per se but it is so awesome that I could not resist to add a reference to it here:

Yeoman is more than just a tool. It’s a workflow; a collection of tools and best practices working in harmony to make developing for the web even better.

Our workflow is comprised of three tools for improving your productivity and satisfaction when building a web app: yo (the scaffolding tool), grunt (the build tool) and bower (for package management).

Check this video for an illustrative introduction to how to use yeoman:

Finally, you can find a super extensive list of resources contributed by the node.js community at StackOverflow.