Skip to content

Instantly share code, notes, and snippets.

def expression_backtrace(backtrace)
new_trace = []
backtrace.each do |line|
match = /(.*):([0-9]+):in/.match line
file, linenum = match[1], match[2].to_i
new_trace << line
if File.exist?(file)
expr = File.readlines(file)[linenum - 1]

Leap Motion + VR in Javascript

Awesome! You’re doing a hackathon. This is a quickstart guide for getting going.

Here are the components you need, after THREE.js and Leap.js:

  • OculusRiftEffect - Renders the lense effect with THREE.js or Mozilla’s native API*.
  • OculusControls.js - Takes position tracking data from your oculus to your web app
  • The LeapJS optimizeHMD flag.
  • leap.transform.js - Re-orients the hand for usage in top-down mode.
@pehrlich
pehrlich / CertificateNSS.cpp
Created July 17, 2015 20:20
Cross Platform Mozilla NSS Root Certificate Installation
#include "stdafx.h"
#include "CertificateNSS.h"
#include "Certificate.h"
#include <boost/filesystem/operations.hpp>
#include <nss.h>
#include <cert.h>
#include <certdb.h>
ProfileLocker::ProfileLocker(const boost::filesystem::path& profilePath) : m_isValid(false)