Skip to content

Instantly share code, notes, and snippets.

View gonnavis's full-sized avatar

Vis gonnavis

View GitHub Profile
@richplastow
richplastow / vue-plus-aframe-test-1.html
Last active September 18, 2018 03:09
Vue plus A-Frame tests
<!DOCTYPE html>
<html lang="en-GB">
<head>
<!-- Technical meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Search engine meta -->
@mathiasbynens
mathiasbynens / jquery.preload.js
Created April 22, 2010 17:11
JavaScript preload() function
/*!
* $.preload() function for jQuery – http://mths.be/preload
* Preload images, CSS and JavaScript files without executing them
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading.
*/
jQuery.preload = function(array) {
var length = array.length,
@jbmoelker
jbmoelker / angular-view-box-directive.js
Last active August 6, 2020 20:49
viewBox is an AngularJS directive which adds support for using an expression for the SVG viewBox, by using `data-view-box` which sets `viewBox` attribute. Code borrowed from http://stackoverflow.com/a/14596319
angular
.module('directives.viewBox', [])
.directive('viewBox', [
/**
* @ngdoc directive
* @name directives.viewBox.directive:viewBox
* @description
* Supports using expression for SVG viewBox, by
* using `data-view-box` which sets `viewBox` attribute.
* Code borrowed from http://stackoverflow.com/a/14596319
@tonygambone
tonygambone / https_forward_proxy.js
Created April 19, 2012 17:02
HTTP/HTTPS forward proxy in node.js
// HTTP forward proxy server that can also proxy HTTPS requests
// using the CONNECT method
// requires https://github.com/nodejitsu/node-http-proxy
var httpProxy = require('http-proxy'),
url = require('url'),
net = require('net'),
http = require('http');
@BlueMagnificent
BlueMagnificent / setupGraphics.js
Last active July 31, 2021 18:03
Javascript 3D Physics Setup Graphics
function setupGraphics(){
//create clock for timing
clock = new THREE.Clock();
//create the scene
scene = new THREE.Scene();
scene.background = new THREE.Color( 0xbfd1e5 );
//create camera
@BlueMagnificent
BlueMagnificent / index.html
Last active July 31, 2021 18:54
Javascript 3D Physics Snippet Three
<html>
<head>
<meta charset="utf-8">
<title>JS 3D Physics</title>
<style>
body { margin: 0; }
</style>
</head>
<body>
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
@BlueMagnificent
BlueMagnificent / contact_manifold_check_two.html
Last active November 16, 2021 06:17
Javascript 3D Physics Tut 3 contact manifold check two
<html>
<head>
<meta charset="utf-8">
<title>Collision JS 3D Physics</title>
<style>
body { margin: 0; }
</style>
</head>
<body>
function memcpy (src, srcOffset, dst, dstOffset, length) {
var i
src = src.subarray || src.slice ? src : src.buffer
dst = dst.subarray || dst.slice ? dst : dst.buffer
src = srcOffset ? src.subarray ?
src.subarray(srcOffset, length && srcOffset + length) :
src.slice(srcOffset, length && srcOffset + length) : src
@mateuszwojt
mateuszwojt / disney_brdf.glsl
Created August 13, 2019 01:51
Disney Principled BRDF GLSL shader implementation
// Principled PBR Path tracer. Except where otherwise noted:
// Copyright © 2019 Markus Moenig Distributed under The MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF