Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Onsi Fakhouri

Onsi Fakhouri is VP of Engineering for Cloud Foundry at Pivotal.

Posts By

Pivotal Acquires CloudCredo

Today, the Pivotal family got a little bigger with the acquisition of CloudCredo, a collection of some of the foremost experts helping companies unlock the power of the Cloud Foundry platform. In this post, Pivotal Cloud Foundry’s Onsi Fakhouri sat down with Colin Humphreys, co-founder and CEO of CloudCredo, to talk through the history of the company and its future at Pivotal.

Read More

In Defense of CodeBabes

Nope. Got nothing.

Go read these two instead.

Read more

Read More

Stand back! I'm going to try science.

For your entertainment. A vignette from my pre-pivotal days.

I wake up, bleary-eyed, and roll out of bed. Squinting I look at the time: 11:27. Perfect. I slide into a pair of jeans and make a pot of coffee. I …

Read more

Read More

Learning Well

One of the benefits of pairing that we emphasize at Pivotal is the learning environment that it provides. We find that one of the best ways to teach a new technology or codebase is to pair up novices with experts. …

Read more

Read More

Crunch Time

It comes up on almost every consulting project I’ve worked on as a pivot, but this particular conversation was memorable. I was surreptitiously ushered into a room by the product manager (PM). Once inside, he shut the door:

So, I …

Read more

Read More

Listening Well

Julie Ann Horvath’s public departure from GitHub has, once again, brought the question of gender equality in the tech world – and the San Francisco tech world, in particular – to the forefront of the blogosphere’s fickle zeitgeist.

Sadly, important …

Read more

Read More

Diego Phase 1: Staging in a multiplatform world

The first phase of Diego’s development has focused on offloading the staging workflow – the task of converting uploaded app bits to compiled droplets ready for running in Cloud Foundry – from the existing DEAs to Diego. From the outset …

Read more

Read More

HM9000: Ready for Launch

Cloud Foundry (CF) is a platform-as-a-service that, once deployed, makes it easy for developers to deploy, run and scale web applications. Powering this elegant PAAS is a complex distributed system comprised of several interoperating components: the Cloud Controller (CC) accepts …

Read more

Read More

Announcing Ginkgo and Gomega: BDD-Style Testing for Golang

I’m happy to announce that Ginkgo, a BDD-style testing framework for Go, and its preferred matcher library Gomega are ready for public release. There’s a comprehensive feature list, on the GitHub READMEs and both projects have extensive documentation written up …

Read more

Read More

Cocktail: DRY up your backbone code with mixins

I've continued to enjoy using Backbone.js to build single page apps. As I've seen more and more real world backbone I've started to develop opinions to augment the blissfully unopinionated little framework that could.

One of these opinions has turned into a mini-library: Cocktail adds functionality to Backbone's extend to facilitate breaking up reusable code into mixins. It's pretty straightforward:

  1. Define your mixin. Mixins are just plain vanilla JavaScript objects with methods and properties hanging off of them. Here's a slightly contrived mixin that makes a view selectable:

    window.MyMixins = {};
    MyMixins.SelectMixin = {
      initialize: function() {
        this.model.on('change:selected', this.refreshSelect, this);
      },
    
    
      events: {
        click: 'toggleSelect'
      },
    
    
      render: function() {
        this.refreshSelect();
      },
    
    
      refreshSelect: function() {
        this.$el.toggleClass('selected', this.model.get('selected'));
      },
    
    
      toggleSelect: function() {
        this.model.set('selected', !this.model.get('selected'));
      }
    }
    
  2. Mix your mixin into your views. It's a one-liner:

    var MyView = Backbone.View.extend({
      mixins: [MyMixins.SelectMixin, MyMixins.SomeOtherMixin],
    
    
      events: {
        'click .myChild': 'myCustomHandler'
      }
    
    
      initialize: function() { ... },
      render: function() { ... },
      etc...
    });
    
  3. That's it! Instances of MyView will automatically inherit the behaviors and methods defined in SelectMixin.

Cocktail brings two simple things to the table:

  • it adds the special mixins:[...] notation to Backbone's extend.
  • it automatically detects and handles method collisions. In the example above Cocktail will wrap MyView's and SelectMixin's implementations of initialize into one method and assign that method to the new, composite, class. The return value of this composite method is the last non-undefined value returned by the methods it wraps. All colliding methods are handled this way, as is the events hash (the events hashes all get merged together).

There are more details and examples at the repo. In particular, there's an example for testing mixins with Jasmine -- it goes over a pattern for writing shared behaviors in Jasmine.

Read More