Skip to content

Instantly share code, notes, and snippets.

View kaosat-dev's full-sized avatar

Mark Moissette kaosat-dev

View GitHub Profile
@kaosat-dev
kaosat-dev / file1.coscad
Created October 5, 2012 22:43
Gist save experiment
class test
constructor:()->
#see https://github.com/joyent/node/blob/master/src/node.js#L367
#and http://stackoverflow.com/questions/9475792/how-does-require-in-node-js-work
#and https://github.com/joyent/node/blob/906a175a0b40fc56dfafbe0929e4fbbb4df68ff2/src/node.js#L699
globals = {}
class Module
constructor:->
@exports = {}
@content = ""
<three-js id="threeJs">
<three-stats id="stats" show></three-stats>
<tween-js></tween-js>
<three-js-scene name="main" active pickable>
<three-directionalLight color="0xffdddd" castShadow shadowDarkness="0.4" pos="[500,200,300]"> </three-directionalLight>
<three-ambientLight color="0xffffff" intensity="0.5"> </three-ambientLight>
<shadow-plane up=[0,1,0]> </shadow-plane>
<mirror-plane up=[0,1,0] resolution=1024> </mirror-plane>
</three-js-scene>
<three-js-scene name="helpers" active>
@kaosat-dev
kaosat-dev / object-rotate-plugin.html
Created November 3, 2014 13:57
Object rotation plugin for usco viewer
<polymer-element name="object-rotate-plugin" >
<script>
Polymer("object-rotate-plugin",{
methodsToInject: ["rotateSelection"],
attached:function(){
this.injectInParent();
},
injectInParent: function() {
@kaosat-dev
kaosat-dev / configuration.h
Last active August 29, 2015 14:10
3DR-TIKI-Belt-detlaconfig
// Enable DELTA kinematics
#define DELTA
// Make delta curves from many straight lines (linear interpolation).
// This is a trade-off between visible corners (not enough segments)
// and processor overload (too many expensive sqrt calls).
#define DELTA_SEGMENTS_PER_SECOND 200
// Center-to-center distance of the holes in the diagonal push rods.
//#define DELTA_DIAGONAL_ROD 191.96 // mm
// ES6 for loops
// =============
// Things in ES6 can be "iterable". Arrays are iterable by default.
var fruits = ['Apple', 'Banana', 'Grape'];
for (var fruit of fruits)
console.log('Fruit: ' + fruit);
@kaosat-dev
kaosat-dev / getSet.js
Last active August 29, 2015 14:18
Omniscient.js cursors getters setters
var data = immstruct({ something: 'initial', another: 'part' });
data.on('swap', function (newData, oldData, path) {
console.log(
"new", newData.toJS(), // { something: "updated", another: 'part' }
"old",oldData.toJS(), // { something: "initial", another: 'part' }
"path",path) // ['something']
});
var MyData={
@kaosat-dev
kaosat-dev / _readme.md
Last active August 29, 2015 14:19 — forked from brigand/_readme.md

These macros are designed to provide a literal notation for [immutable-js][1] using [sweetjs][2].

The most interesting being the Map literal

var map = im{"foo": "bar", "baz": "quux"};

This compiles to the 2d array version of Immutable.Map.

@kaosat-dev
kaosat-dev / index.js
Created April 15, 2015 13:09
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
/*var Immutable = require('immutable');
var diff = require('immutablediff');
var map1 = Immutable.Map({a:1, b:2, c:3,e:{a:42,stuff:"stom"} });
var map2 = Immutable.Map({a:1, b:2, d: 4,e:{c:4,foobar:4564}});
var a = diff(map1, map2);
console.log("blah",a.toJS());*/
@kaosat-dev
kaosat-dev / results.txt
Last active August 29, 2015 14:21 — forked from maxpert/results.txt
lz4 + json
Original tweet size in JSON 2624 Msgpack = 1817 Gzip + Json = 1058 Gzip + Msgpack = 1116 LZ4 + Json = 1628 LZ4 + Msgpack = 1361
Original tweet size in JSON 1863 Msgpack = 1443 Gzip + Json = 0783 Gzip + Msgpack = 0835 LZ4 + Json = 1153 LZ4 + Msgpack = 1040
Original tweet size in JSON 2074 Msgpack = 1670 Gzip + Json = 0842 Gzip + Msgpack = 0894 LZ4 + Json = 1229 LZ4 + Msgpack = 1139
Original tweet size in JSON 2025 Msgpack = 1617 Gzip + Json = 0845 Gzip + Msgpack = 0895 LZ4 + Json = 1238 LZ4 + Msgpack = 1143
Original tweet size in JSON 2069 Msgpack = 1663 Gzip + Json = 0846 Gzip + Msgpack = 0901 LZ4 + Json = 1243 LZ4 + Msgpack = 1164
Original tweet size in JSON 2035 Msgpack = 1634 Gzip + Json = 0852 Gzip + Msgpack = 0907 LZ4 + Json = 1247 LZ4 + Msgpack = 1167
Original tweet size in JSON 1988 Msgpack = 1464 Gzip + Json = 0804 Gzip + Msgpack = 0862 LZ4 + Json = 1220 LZ4 + Msgpack = 1061
Original tweet size in JSON 1910 Msgpack = 1502 Gzip + Json = 0775 Gzip + Msgpack = 0832 LZ4 + Json = 1154 LZ4 + Msgpack = 1060