Skip to content

Instantly share code, notes, and snippets.

@bengfarrell
bengfarrell / randomcoords.cpp
Last active Apr 17, 2020
Random Coordinates C++ Node.JS AddOn
View randomcoords.cpp
#include <node.h>
#include <v8.h>
#include <stdio.h>
#include <stdlib.h>
using namespace v8;
Handle<Value> getRandomCoords2D(const Arguments& args) {
HandleScope scope;
@bengfarrell
bengfarrell / SimpleViewerCustom.java
Created Dec 12, 2012
Customized version of SimpleViewer sample from OpenNI where we combine depth and RGB data
View SimpleViewerCustom.java
/****************************************************************************
* *
* OpenNI 1.x Alpha *
* Copyright (C) 2011 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* OpenNI is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as published *
* by the Free Software Foundation, either version 3 of the License, or *
@bengfarrell
bengfarrell / instance_v_proto.js
Created Aug 7, 2012
Instance vs Prototype definitions
View instance_v_proto.js
/**
* don't know how to use prototype style class defs. It's possible to use method.apply to infer scope,
* however it gets complicated when using 3rd party libs and passing a cb function as a parameter.
* I've seen context wrappers that do this, but it seems overly complicated when I can just use instance style
*/
function InstanceStyleTest() {
var self = this;
this.methodA = function() {