Skip to content

Instantly share code, notes, and snippets.

View funnylookinhat's full-sized avatar

David Overcash funnylookinhat

View GitHub Profile
@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 / gist:1b1979ea9ce7e43431005082f6001374
Created April 7, 2022 12:25
Typescript Flatten Nested Interface
// Source: https://www.typescriptlang.org/play?noErrorTruncation=true&ts=4.4.2#code/HYQwtgpgzgDiDGEAEB5ATgSwOZIN4CgkikNgAXCNAMwWQDEB7BvQ4tqpgLiSjM2Cys2RAEYg0Afm7AArmBGUhw4NAoATbgWHakHBt178sAGiU6kaiBBgAbAJ4A5VRA0tz5sZOlyFaMzoBffyIg8xlgDAZgAz5SHAAfN3ciPRijU2TRcSkkWXlFc1DiIKUyOxh6JjobEDIKFTUkAF4katr6gB5GBgA+JQB6ACokMorWqpq6iAbmpPYuHliBAG5-ACIVXhcAOj01tLjV7XDI6MWjI+E1k6jdpn3zw-9PHLzfJETwyypSF0u2DbONTbSzWexOLbAzxrV4+SgfJBfCA-Br-YjXCK3aGw-JoBFIlF-JQBQb9fBKUgUai0cYMNpTBoAWRAshANjmwlSjwEwSQL28uN5gMhdwYD0McSFm3UIKstkcQO22IFvnJ5n6-RIVERmOAJCgSBA3KwnF5NzOEp5vI1Wp1p31hr1DBEACsIPAyKbzBjTqLxUtBN7zUrxDCVQVimriKNkAA1SgYKh2ADK4GQLUZMjIMjZ9gAogAPepqKBdCbtaYuYy0+n1FzM1k2PolSmUGiIWkcshgNQicN4xJaHRkDBkGwQTS8tgMTBYUhsg48zJILCUMAsnKWwOBXkiGRqVdkHGq8xoCAAN2mMggx4j2jIICwNl+m4DvIYl7Q54wEAA7q+jF5GA0AYNQZA9U4AGEGDAOAImgHIh2SDA1FvPxlxsBgsAYAAFWoAAsAMlZdQEgIil0yGdsFIaDwj4OxyO3bQAgAbQAXV5M9xxAKAIAAEVqG9FyY4RV2AM8oEY9jOLojAyP7ICGC2LxjQRJD3DUWoQE0HhwFsCdHTsJAAiQKdiHgKJ6jIAAVcoDK3XkihCJQ0FqOIdPgfD+2WJA0E9XI4TxEzBxGBgHxsftjKUTSKGTKxgByASKCUKgo
@funnylookinhat
funnylookinhat / docker-compose.yml
Created April 5, 2022 03:22
docker-compose reverse https proxy with traefik using self-signed certificates
# This example demonstrates using Traefik as a quick HTTPS reverse proxy for local
# docker-compose development. It's a common requirement to need to test with SSL
# locally (simulating how load balancers are exposed in production), but most of the
# examples out there require nginx (and a configuration file, and certificates, and
# volumes mapping all of that).
#
# Traefik (and other tools like it: Caddy, Envoy, Istio) make configuration via
# docker labels extremely easy. In this example, we use labels on the "app"
# server to route all traffic from HTTPS (443) to an application exposed on
# port 3000.

Keybase proof

I hereby claim:

  • I am funnylookinhat on github.
  • I am funnylookinhat (https://keybase.io/funnylookinhat) on keybase.
  • I have a public key ASDyW8Os5mUayRbZJ_PhLVfFwq760SRUa8KHINKsjOY0Jwo

To claim this, I am signing this object:

@funnylookinhat
funnylookinhat / test.js
Created March 23, 2016 15:59
Check if you have any of the recently unpublished dependencies.
var fs = require('fs');
var baddies = ['abril-fatface','ada','after-time','alert','andthen','anglicize','ansi-codes','atbash','attr','attrs','available-slug','background-image','ballet','binding','bind-key','blending-modes','boxcars','brick','brick-browser','brick-browserify-plugin','brick-node','browserify-length','bud','bud-babelify','bud-browserify','bud-concat','bud-indexhtml','bud-live-server','call-all','categorize-files','center-box','centered','centered-cover-background','change-object','change-object-path','checkfor','circle','cli-form','cli-qa','combiner','comma-list','comp','concat','config-doc','core-modules','cover-background','create-temp-dir','debounce-fn','declarative-js','default-debug','delegate-dom','dom-children','dom-classes','dom-event','domflow','domquery','dom-select','dom-style','dom-tree','dom-value','door','duba','eksi-server','eksi-sozluk','english-time','environ','every-time','expand-home-dir','failing-code','failing-line','filename-id','filter-stack','findall','first-val','flat-
this._computeClient = require('pkgcloud').createClient('compute',{
enableExtensions: true,
provider: this._stackProvider,
username: this._stackUsername,
apiKey: this._stackApiKey,
authUrl: this._stackAuthUrl
});
this._storageClient = require('pkgcloud').createClient('storage',{
enableExtensions: true,
{ [Error: rackspace Error (400): Bad Request]
name: 'Error',
provider: 'rackspace',
failCode: 'Bad Request',
statusCode: 400,
href: 'http://10.17.76.8:8774/v2/25ae5144f9824092917e8b4463901dfd/servers',
method: 'POST',
headers:
{ 'content-length': '98',
'content-type': 'application/json; charset=UTF-8',
@funnylookinhat
funnylookinhat / rbgaconvert.js
Last active December 28, 2015 05:19
RGBA Convert: Using RGBA pixels from images to create a wide array of heightmap values.
/**
* RGBA Convert
* Converting RGBA values to/from heightmap values ( i.e. signed "3 decimal" numbers )
* Expected range +/- 999999.999
*/
function convertToRGBA(value) {
value = parseInt(1000 * (parseFloat(value).toFixed(3)));
var a = value & 255; value = value >>> 8;
var b = value & 255; value = value >>> 8;
@funnylookinhat
funnylookinhat / new_gist_file
Last active December 27, 2015 04:09
lmg grid overlay
uniform vec2 gridSize;
const vec4 gridColor = vec4(1.0,0.5,0.0, 0.1);
const float gridLineWidth = 0.03;
const float gridLineFade = 0.01;
// overlay grid
vec2 xy = vUv * gridSize;
vec2 dGrid = abs(xy - floor(xy+0.5)); // floor(i+0.5) == round
vec2 d = min( 2.0 * abs(dGrid) - (gridLineWidth/2.0 - gridLineFade), gridLineFade) / gridLineFade;
gl_FragColor.rgb = mix( gl_FragColor.rgb, gridColor.rgb, (1.0 - min(d.x,d.y)) * gridColor.a );
@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)/