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.

 

How I got the Shittalk Generator to 80kb pagesize

  • Posted on: 30 March 2016
  • By: davis

Lesson #1: Probably shouldn't have named it Shittalk Generator. It's hard to tell your family what it is. "Well... it's a script to shittalk people". Maybe I would have named it the Trash Talk Generator, in restrospect

You can track the actual commits I made on Github, you'll see the progression in pagesize.

Here are some notes:

Minify HTML (http://www.willpeavy.com/minifier/)

Pages