Skip to content

Instantly share code, notes, and snippets.

@facultymatt
facultymatt / calibrations.md
Last active November 2, 2024 14:26
openFrameworks Kinect & projector calibration

Kinect/ projector calibration and mapping:

Map Projections to moving objects in real time.

Uses the Kinect to track and locate objects. Might be overkill for this project since the table doesn't move. However might be cool to use in reverse to NOT project onto people who are interacting with the table: http://chparsons.com.ar/#camara_lucida

Kinect projector calibration

Another example that might be overkill since the table is static.

{
"directory": "components"
}
@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs
@facultymatt
facultymatt / Procfile
Created April 12, 2013 16:23
Get Deployd running on Heroku!
web: node server
@facultymatt
facultymatt / index.php
Created October 16, 2012 01:29
Codeigniter subdomain routing index file. Support for admin dashboard.
<?php
date_default_timezone_set('America/New_York');
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your
@facultymatt
facultymatt / server.js
Created November 8, 2013 21:51
Simple server
/**
* Add express to package.json
* Keep the app.get('*') for nice sinlge page app support
*
*/
var express = require("express"),
app = express(),
port = parseInt(process.env.PORT, 10) || 4567;

Workflow

  • Make changes on develop. Commit and push to origin.
  • Swtich to master, pull and merge from orgin.
  • IMPORTANT: You'll need to commit the build files since the build process times out on Heroku and so you need to do it locally.
  • From your Master Branch, change your .Procfile to web: ./node_modules/.bin/grunt build optimize && node server/server
  • Run $ foreman start which will simulate building on Heroku.
  • You should now have a bunch of new files in your build folder. Commit those. DONT COMMIT THE PROCFILE!
  • Now, back to normal...
  • Wait! Make sure to test the app as building and minification often breaks stuff!
@facultymatt
facultymatt / images.js
Created October 10, 2013 19:04
Example image controller
function ImagesController($scope, $routeParams, $location, Global) {
// get global settings
$scope.global = Global;
// set filepicker key
filepicker.setKey('Akpol0G7ZQ7ODgRPSZPJRz');
// define our empty image object
$scope.newImage = {};
// A design pattern for a mean.io notifier module
var transport = null; // will store our connection to nodemailer
var actions = ['generate_quote', 'generate_application', 'submit_application']; // actions allowed to email
// There is no model
exports.initModel() {}
// There are no routes
exports.initRoutes() {}
@facultymatt
facultymatt / email_best_practices.md
Last active December 23, 2015 06:19
Node Email / notifier Best Practices

Emailer / Notifier Best Practices

  • Supports any protocol, ideally by just setting a config option or function.
  • Supports sendgrid, which is a Heroku based app, making it super simple to get running on develop.
  • Won't fail, or catches errors, if any variables are missing.
  • Checks for development and testing environments, and prevents email send (console.log instead)
  • REUSABLE! The library itself, and maybe even the template, should be resuable across projects.

Good Looking Approaches