Primitive Pics: A Really Cool Go Project

  • Posted on: 20 September 2016
  • By: davis

https://github.com/fogleman/primitive

This is a really neat project that allows you to create cool photographs from your input.

A target image is provided as input. The algorithm tries to find the most optimal shape that can be drawn to minimize the error between the target image and the drawn image. It repeats this process, adding one shape at a time. Around 50 to 200 shapes are needed to reach a result that is recognizable yet artistic and abstract.

TypeError: Cannot read property 'timeout' of undefined with Mocha and Fat Arrow Syntax

  • Posted on: 12 July 2016
  • By: davis

Don't do this: 

describe('Do Something', () => {
  it(`Should do stuff successfully`, (done) => {
    this.timeout(20000);
    // *this* binding refers to parent function scope in fat arrow functions
    // this will fail, no pun intended

    // do stuff here and include done() in the callback

Replace it with a normal function - fat arrow syntax will assign the "wrong" scope to timeout(), and you'll get an error like TypeError: Cannot read property 'timeout' of undefined

Drupal Sucks

  • Posted on: 25 June 2016
  • By: davis

I haven't written anything in a long while, so you'd think I'd be neutral about Drupal, right?

No. I don't like this platform at all. I kept this website on Drupal because it would be a good resume-filler. I value the experience I've gained from wrestling with it, but goddamnit, I am sick of updating Drupal and taking care of it.

No auto-update for security vulnerabilities. Clumsy module system. Unintuitive taxonomy system. All around clunky.

 

Pages