Nov 9, 2013

Managing multiple ssh keys with heroku

As soon as you mix personal and work heroku accounts you're likely to run into this error:

$ git push heroku master

 !  Your account you@yourplace.com does not have access to your_repo.
 !
 !  SSH Key Fingerprint: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
Thankfully the heroku-accounts plugin can help you manage your various heroku accounts. Read more about it here.

Aug 27, 2013

Converting a PDF to PS without the LZWDecode filter

I wanted to alter diagrams in a PDF and figured I'd convert it to a postscript file to do that. What got in my way was the LZWDecode filter in my postscript file. Here's what I did to get around it:

1. use qpdf with the --stream-data=uncompress option
2. use pdftops (not pdf2ps)

On the Mac I use homebrew to install the qpdf and poppler packages respectively.

You can convert pdf and ps files using imagemagick, although don't forget to install gs beforehand. The secret sauce option to get high resolution images out was the -density flag. E.g.:

convert -density 525 some_pdf_or_ps_file page%05d.png

I hope that helps you!

May 18, 2013

Module Driven in node.js

I was inspired by the talk that Thorsten Lorenz gave at NodePDX yesterday, and I've been making an effort to take his advice.

Even using pkginit, it was still annoying to have to create the same old .gitignore file, and duplicate portions of the package.json in the README.md.

That's why I created module-driven. I encourage you to give it a try. Here's what a run-through looks like using my template:

$ npm install -g module-driven

$ moduleDriven easy-peasie
description: Get going, fast!

$ find easy-peasie
easy-peasie
easy-peasie/.gitignore
easy-peasie/package.json
easy-peasie/README.md
easy-peasie/test

$ cat easy-peasie/package.json
{
  "name": "easy-peasie",
  "description": "Get going, fast!",
  "version": "0.0.1",
  "repository": {
    "url": "git://github.com/curious-attempt-bunny/easy-peasie.git"
  },
  "main": "index.js",
  "scripts": {
    "test": "tap test/*.js"
  },
  "dependencies": {
  },
  "devDependencies": {
    "tap": "~0.4.3",
    "tape": "~1.0.2"
  }
}


By way of explanation here's the contents of my ~/.content/module-driven folder:


$ cat ~/.config/module-driven/package.json.mdtmpl 
{
  "name": "{{name}}",
  "description": "{{description}}",
  "version": "0.0.1",
  "repository": {
    "url": "git://github.com/curious-attempt-bunny/{{name}}.git"
  },
  "main": "index.js",
  "scripts": {
    "test": "tap test/*.js"
  },
  "dependencies": {
  },
  "devDependencies": {
    "tap": "~0.4.3",
    "tape": "~1.0.2"
  }
}

May 17, 2013

nodepdx 2013: Building a Multiplayer World for Pillow Pets

[Lanyrd notes] Charlie sketched out their approach to implementing Pillow Pets World.

nodepdx 2013: minecraft.js

[Lanyrd notes] Max is the author of voxeljs and the free online book The Art of Node. For peer-to-peer communication in the browser, check out peer.js.


2013 nodepdx: Module Driven Development

[Lanyrd notes] This was a fantastic talk. Thorsten made a compelling case for aggressively factoring your apps into modules:

  • Everything in your lib folder is a candidate for a node module. Publish it!
  • Every module is a function (module.exports = function (..) { .. })!
  • Hoogle is the inspirations for a library of functions
  • Put each function in a separate file (it makes coupling code harder)
  • Include tests and demonstrate that it works now (travis / testling)
  • replpad
  • Use npm init of pkginit
  • travisify
  • npm link

May 16, 2013

Quadcopter hacking in node.js with ar-drone and opencv

Here's a video of an AR Drone controlled by my node.js code: On the bottom left of the video you can see my computer screen with the video stream from the quadcopter. I had it set up to use opencv and the cv.FACE_CASCASE object detection, so it actually turned towards you. Fun stuff!

nodepdx 2013: Introducing NodeSecurity.io

[Lanyrd notes] Adam presents the Node Security Project which aims to find and fix security problems in npm modules.

nodepdx 2013: Programming with a Purpose

[Lanyrd notes] Jason challenged us to be selective about what we put our effort into - "we make systems, our systems effect the real world, we are the scarcity, we have as much power as we can recognize [to build the kind of world we want to live in]"

nodepdx 2013: Thursday Lightning Talks


  1. Passport - express middleware for OpenID authentication.
  2. Scoping rules in JavaScript
  3. Scaling yourself "being busy is a form of laziness [i.e. indiscriminate action]", "don't put energy into things you don't want more of"