Skip to content

Instantly share code, notes, and snippets.

Josh Staples cubicleDowns

  • San Francisco, CA
View GitHub Profile
View gist:60920fb09f6b8346362abc76b35a0bf9
<div style="display:flex;justify-content:center;align-items:center;">
cubicleDowns / speedup.js
Created May 3, 2016
Angular Speedup - Disable Debug Info
View speedup.js
.config(function($compileProvider) {
cubicleDowns / Gource a git video
Created Mar 17, 2016
Script to output a source tree video of all commits via gource.
View Gource a git video
# install brew
# download gource
# brew install all pre-reqs for gource.
# configure, make, make install
# use following script to output a movie.
# -s is seconds per day. In this example, 1 second is 10 days. 1/10 == 0.1 You'll want to tweak this value.
View gulpfile.js
* This gulpfile will copy static libraries and a index.html file as well as
* merge, babelify and uglify the rest of the javascript project.
* - Separate media, libs and src with different watchers.
* - Media and libs should only be copied to dist if they are different sizes.
* The expected project is to be laid out as such:
View getscopes.js
function getScopes(root) {
var scopes = [];
function traverse(scope) {
if (scope.$$nextSibling)
if (scope.$$childHead)
cubicleDowns / ngExceptions.js
Created Oct 13, 2014
Angular Error Exception Module
View ngExceptions.js
//inject the module as such
var myApp = angular.module("myApp", ['ngExceptions'])
// put this in one file.
(function(window, angular) {'use strict';
* @ngdoc module
* @name ngExceptions
* @description
cubicleDowns / threefactory.js
Last active Aug 29, 2015
Example of a THREEjs factory and an exposed API.
View threefactory.js
"use strict";
tttApp.factory('ThreeEnv', function ($http, $log, $rootScope ) {
var demo,
rotateCamera = true,
canvas = document.getElementById('ttt-canvas');
* Initialize the 3D scene.
cubicleDowns / controller.js
Created Feb 9, 2014
Example of an AngularJS controller accessing a THREEjs factory. In this example, I am simply calling the exposed API to modify the THREEjs scene.
View controller.js
"use strict";
tttApp.controller('TTTController', function ($scope, ThreeEnv) {
$scope.dims = 3;
$scope.usercolor = "#0000FF";
$scope.username = "Player1";
$scope.userfirst = false;
cubicleDowns / clickDirective.js
Created Feb 9, 2014
Example of using an AngularJS directive to interact with a THREEjs factory.
View clickDirective.js
"use strict";
tttApp.directive("selectcube", function(ThreeEnv){
return {
restrict: "A",
link: function(scope, element){
var offsetLeft = element[0].offsetLeft,
offsetTop = element[0].offsetTop,
cubicleDowns / object4d-manager.js
Last active Dec 31, 2015
Object4D animation and tweening. You can read more on my blog,
View object4d-manager.js
var Demo = Demo || {};
// This object manages all of the 4D objects.
// Between renders, it'll take the difference between the last render and the current time.
// This Time Delta is passed to each Object4D object.
// Each Object4D object will then move a distance based upon their individually set speed,
Demo.Manager = function () {
this.clock = new Demo.Clock();
You can’t perform that action at this time.