Skip to content

Instantly share code, notes, and snippets.

View funnylookinhat's full-sized avatar

David Overcash funnylookinhat

View GitHub Profile
/**
* Static Quad Tree
* This is a one-way tree that only allows insertion for maximum efficiency.
* @author David Overcash <funnylookinhat@gmail.com>
* Credit to https://github.com/mikechambers/ExamplesByMesh for a great example.
*/
(function(exports) {
var Node = (function (constructParams) {
var _MAX_ITEMS = 4;
/**
* Static Quad Tree
* This is a one-way tree that only allows insertion for maximum efficiency.
* @author David Overcash <funnylookinhat@gmail.com>
* Credit to https://github.com/mikechambers/ExamplesByMesh for a great example.
*/
(function(exports) {
var Node = function (xMin,xMax,yMin,yMax) {
this._quad = {
@funnylookinhat
funnylookinhat / OldStaticQuadTree
Created January 28, 2013 17:30
Comparing two class definitions for NodeJS exports.
/**
* Static Quad Tree
* This is a one-way tree that only allows insertion for maximum efficiency.
* @author David Overcash <funnylookinhat@gmail.com>
* Credit to https://github.com/mikechambers/ExamplesByMesh for a great example.
*/
(function(exports) {
var Node = (function (constructParams) {
var _MAX_ITEMS = 4;
@funnylookinhat
funnylookinhat / gist:5062061
Last active December 14, 2015 08:59
tree.js
{
"metadata" :
{
"formatVersion" : 3.1,
"generatedBy" : "Blender 2.65 Exporter",
"vertices" : 8637,
"faces" : 4778,
"normals" : 8242,
"colors" : 3,
@funnylookinhat
funnylookinhat / ColladaLoader.js
Created March 13, 2013 20:03
ColladaLoader.js
/**
* @author Tim Knip / http://www.floorplanner.com/ / tim at floorplanner.com
*/
THREE.ColladaLoader = function () {
var COLLADA = null;
var scene = null;
var daeScene;
@funnylookinhat
funnylookinhat / interfaces
Last active December 15, 2015 14:19
VirtualBox Devstack setup...
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
[playlist]
NumberOfEntries=4
File1=http://slacker.cvgm.net:8000/cvgm128
File2=http://relay3.slayradio.org:8000/
File3=http://radio.modules.pl:8500/
File4=http://audio.misproductions.com:80/japan128k
@funnylookinhat
funnylookinhat / replace_url.php
Created April 17, 2013 18:16
RegEXP Find / Replace URLs with Links
<?php
// RegEXP
// @(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-\+]*(\?\S+)?[^\.\s])?)?)@
$string = "Whatever!";
$new_string = preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-\+]*(\?\S+)?[^\.\s])?)?)@', '<a href="$1" target="_blank">$1</a>', $string );
header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');
@funnylookinhat
funnylookinhat / tracking.md
Last active December 26, 2015 09:09
Tracking code regexps

###UPS

/\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\dT]\d\d\d ?\d\d\d\d ?\d\d\d)\b/

###FEDEX

/(\b96\d{20}\b)|(\b\d{15}\b)|(\b\d{12}\b)/