Upgrading my Mac Pro (In Pictures)

I’ve always dreamed of having a do it all high end workstation to do my experiments on. Something with fast storage, lots of ram and at least one fast GPU. As you may have gathered from my blog, I tend to dabble in different things so having a powerful machine allows me the flexibility that my laptop (A retina Macbook Pro) lacks. So a year ago, I bought a 2009 Mac Pro off my friend fairly inexpensively with the intention of turning it into a power machine. »

TIL(oved): destructuring in Coffescript

I’ve talked about destructuring before on this blog, I think it’s a pretty useful langauge feature and use it where I can. So today, I was writing a CSV importer which returns each row as an array like [thing1,thing2,thing3] so I started writing processRow: (argsArray)-> firstName = argsArray[0] lastName = argsArray[1] when I had a thought, what if I could break the array elements into function arguments? I could do something janky like this »

Michael Francis

Awesome SASS: Mixins

I’ll be the first to admit, that despite considering myself a fullstack developer, my CSS knowledge is pretty limited. I know enough to say, assign a div a background color, and give it appropriate styling, but I shy away from the idea of writting CSS skeleton code from scratch and thus always rely on something like Bootstrap or Foundation for my projects. Up until recently, every project I had worked on with bootstrap used the compiled bootstrap CSS. »

Michael Francis

Ruby parameter expansion

If you’re familiar with ruby, you probably have seen multiple assignment before which looks like first, second = 1,2 or first, second = [1,2] but did you know you could do multiple assignment in method params like so: def test yield [1,2] end test do |(first, second)| "First is #{first} and second is #{second}" end Say for example you have an method that returns an array of tuples (something that’s unfortunately pretty common) such as »

Michael Francis

Abusing Reduce

As someone who enjoys functional programming languages (ruby, scala, javascript) one of my most used commands is reduce. The canonical example of reduce is summing a bunch of numbers such as [1,2,3].reduce(function(sum, number) { return sum+number }) or elegantly in ruby [1,2,3].reduce(:+) which would produce 6 However, I see reduce as more of a function you can use to build other functions from. For example, I recently wanted to write my own version rubys . »

Michael Francis

Post title

differences between browser and node determining the correct behaviour in each environment / situation how do JS components like sliders work with JS turned off? routing 404s, how do you know if a page exists before rendering the app? performance caching »

Moving to Containers Part 1: Building a PaaS

I’ve done my research and I’m mostly ready to build my dream PaaS, most of the pieces are assembled. So far we have Dokku as the PaaS layer NodeJS build pack for app(s) TokuMX for persistence (experiemental) Redis Graylog2 (for system and app logging, experiemental) Elasticsearch (for graylog2 mostly) I’ll begin by talking about setting up Dokku. First you’ll need a host for dokku, (preferably a clean Ubuntu 13. »

Michael Francis

Moving to containers part 2: Redis & mongo

Installing and setting up Redis is a breeze, you just follow the instructions here, once done, create a redis container for your app using dokku redis:create then push it’ll automatically be linked to your app. Inside your app a new enviroment variable will appear, REDIS_URL which will be in the format redis://:. I’m using redis inside the sample app for session storage but it expects host and port to be seperate, like so »

Michael Francis

Inline string formatting with Javascript

One thing I miss in javascript coming from Ruby and Python is a quick and easy way to format strings. It’s quite common in javascript to see developers doing things like var str = 'my name is ' + name; Which I find messy and unintuative. Therefore, here’s something I use in my node apps to make string formatting a bit easier var format = require('util').format; /** * Formats a string by replacing the placeholds with * with the specified variables */ String. »

Michael Francis

Why you can't get a job and what you can do about it

TL;DR You’re generally unemployable You don’t really want to work anyway You’re not better than your competition You don’t bring anything to the job You’re generally un-employable My girlfriend was previously an employment counsel our and while that was an obviously small sample size, the one reoccurring theme she found with many of the people who came in was they had issues that made it hard for them to get jobs, that had nothing to do with their professional skills. »

Michael Francis