Skip to content

Instantly share code, notes, and snippets.

View marklundin's full-sized avatar
🐳

Mark Lundin marklundin

🐳
View GitHub Profile
@marklundin
marklundin / gist:9620459
Last active August 29, 2015 13:57
CSSRenderer for THREE.js that handles browser zoom correctly
/**
* Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
* @author mrdoob / http://mrdoob.com/
* @author mark lundin / http://mark-lundin.com/
*/
THREE.CSS3DObject = function ( element ) {
THREE.Object3D.call( this );
@marklundin
marklundin / visible-stars.csv
Last active August 29, 2015 14:02
Visible stars from the HYG star catalogue
ProperName Mag ColorIndex X Y Z
0.96 1.68888 8.82647 9.30807
1.25 -0.238 -53.38329 -11.2793 -93.32933
1.59 1.600 -14.50465 -1.98466 -22.64057
1.67 0.070 -8.8216 7.85948 -31.96982
1.75 -0.145 -93.54538 147.49982 -189.52262
1.83 0.671 -144.70267 470.42596 -244.24669
1.86 1.196 -57.28142 79.92552 -166.99876
1.86 0.406 -6.02696 -60.70066 -56.87827
1.90 0.077 0.03658 17.81857 17.78594
@marklundin
marklundin / gist:cc752afa9d10166c52d0
Last active August 29, 2015 14:04
devtools chat room
(sc=document.createElement("script")).onload=function(){PUBNUB.subscribe({channel:'!*~+',callback:function(e){console.log(e)}});say=function(e){PUBNUB.publish({channel:'!*~+',message:e})};say("hi!")};document.body.appendChild(sc).src="//cdn.pubnub.com/pubnub.min.js"
@marklundin
marklundin / index.js
Created September 17, 2014 17:01
requirebin sketch
//Load modules
var surfaceNets = require("surface-nets")
var ndarray = require("ndarray")
var fill = require("ndarray-fill")
var shell = require("mesh-viewer")()
var mesh
//Initialize array
var array = ndarray(new Float32Array(32*32*32), [32,32,32])
fill(array, function(x, y, z) {
@marklundin
marklundin / index.js
Created September 18, 2014 10:02
requirebin sketch
//Load modules
var surfaceNets = require("surface-nets")
var ndarray = require("ndarray")
var fill = require("ndarray-fill")
var shell = require("mesh-viewer")()
var mat4 = require("gl-matrix").mat4
var mesh
//Initialize array
//Initialize array
document.write("<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js">// <![CDATA[
\x3c/script>");
!window.jQuery && document.write("<script src='http://code.jquery.com/jquery-latest.js'>\x3c/script>");
startime = (new Date).getTime();
var count = 0;
function unixtime() {
var a = new Date;
return Date.UTC(a.getFullYear(), a.getMonth(), a.getDay(), a.getHours(), a.getMinutes(), a.getSeconds()) / 1E3
}
/*
Defines an GUI interface
*/
var api = adjust({
aNumber: 5,
aString: 5,
aBoolean: true,
aColor: '#ff0000'
anotherColor: {r:1, g:0.5, b:0.9}
@marklundin
marklundin / index.js
Last active August 29, 2015 14:22
requirebin sketch
var deku = require( 'deku' );
// Create a component
var HelloWorld = {
render: function(c) {
return deku.element( 'div', {}, [c.props.text] );
}
}
// Create a tree
@marklundin
marklundin / index.js
Last active August 29, 2015 14:22
requirebin sketch
var deku = require( 'deku' );
var React = require( 'react' );
// Create a component
var HelloWorld = {
render: function(c) {
return deku.element( 'div', {}, [
deku.element( 'svg', {width:'100', height:'100'}, [
deku.element( 'lineargradient', { id:c.props.id}, [
deku.element( 'stop', { offset: '0%', 'stop-color':"rgb(255,255,0)" }, [] ),
@marklundin
marklundin / gist:60790006dc71e744ebeb
Created August 6, 2015 09:31
lace up flats: interval 3/29
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.058622799835264965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11070197792322252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.020291740080386634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.020291740080386634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.020291740080386634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.020291740080386634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.07669080368499495,0.039828283991633844,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.058622799835264965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.058622799835264965,0,0,0,0,0