Skip to content

Instantly share code, notes, and snippets.

@peterbraden
peterbraden / gist:4455096
Created January 4, 2013 19:11
Fix Google Drive's Crappy App with this Crontab
0 * * * * ps aux | grep "Google Drive" | grep -v grep | awk '{ print $2 }' | xargs kill -9 && open /Applications/Google\ Drive.app
@peterbraden
peterbraden / gist:5043452
Created February 26, 2013 23:43
WIP interface for easy face recognition from a stream of images (for example from AR Drone)
var matrixStream = new cv.ImageStream()
, faceRecognitionStream = new cv.ObjectDetectionStream(cv.FACES_CASCADE)
faceRecognitionStream.on('data', function(faces){
console.log("FACES!", faces);
})
matrixStream.pipe(faceRecognitionStream);
@peterbraden
peterbraden / gist:5085251
Created March 4, 2013 20:17
blog post code 1
var s = new cv.VideoCapture(0)
var detect = function(){
s.read(function(im){
im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){
console.log("I spy", faces.length, "faces...")
detect();
})
})
}
@peterbraden
peterbraden / gist:5085258
Created March 4, 2013 20:18
blog post code 2
var matrixStream = new cv.VideoCapture(0).toStream()
, faceRecognitionStream = new cv.ObjectDetectionStream(cv.FACE_CASCADE)
faceRecognitionStream.on('data', function(faces){
console.log("I spy", faces.length, "faces...")
})
matrixStream.pipe(faceRecognitionStream)
matrixStream.read()
@peterbraden
peterbraden / hipache.pp
Created October 1, 2013 23:25
Hipache Puppet Manifest
class hipache {
include nodejs
include redis
package { 'hipache':
ensure => present,
provider => 'npm',
}

I don't know if you've heard of type 2 fun. Type 1 fun is the fun that we're all familiar with - eating ice cream in the sunshine with friends, that sort of deeply pleasant thing.

Type 2 fun is when you are hurting, tired, sweaty, kind of regretting life in a lot of ways, the sort of fun where you question you decisions. But afterwards, when you're drinking a beer, your muscles are all warm and glowing, you kind of think, that wasn't so bad, that was fun. That's type 2 fun! I kind of think of it as the Stockholm syndrome of fun.

Now I think if you get into most sorts of sports deeply enough, it kind of becomes type 2 fun - running marathons, triathlons, that sort of thing - those fall deeply into the realm of type 2 fun. But I can't think of a sport that embraces type 2 fun more wholly, more unabashedly, more completely, than mountaineering.

It's hard to argue that shivering in a blizzard at the top of an icy cliff above chasms of death in the worst sorts of weather the planet has is anything more tha

@peterbraden
peterbraden / 1-readme.md
Created May 28, 2014 15:24
Atomic Design Ideas

molecule

Atomic Design building block

You're building with Atomic Design:

myPage.js

var Template = require('molecule');
@peterbraden
peterbraden / readme.md
Last active August 29, 2015 14:02
Front End Components

Front End Component Spec

In order to write reusable and modular FE code, we need a system to define modular components. This requires:

A Package Manager

FE components need to be installedto the right location with their dependencies.

Examples:

  • Bower
@peterbraden
peterbraden / index.js
Created September 25, 2014 08:50
Retina.js with browserify
var retina = require('retina.js')
retina.Retina.init(window); // <-- Necessary to initialise with window.
@peterbraden
peterbraden / gist:b0a13390c50e25e1b4da
Last active August 29, 2015 14:09
Lightroom Corruption Post-mortem

I use Lightroom heavily to process my images. I have 400gb of pictures, so there really isn't any other option to manage such a large collection.

Because my photos are very important to me, I've invested serious thought and time into their backups. Even still, last night I realised that Lightroom had crashed, and the catalog had reverted to its state from around a month ago.

This means that I lost a huge amount of categorisation, sorting, and processing from the last month (conservative estimate, 20 hours work).

It appears that the images are intact, however the catalog that stores all 'collection' level metadata has gone.

I have several layers of backup. The first, Google Drive, was useless, as it had backed up the 'backed up' catalog. Because I had designed the backup system for loss, rather than corruption, I didn't have any versioning here, and Google Drive's versioning didn't have a working catalog.