![]() |
![]() |
![]() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(require,exports,module){ | |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// // | |
// client/imports/apps/polydance.vue // | |
// // | |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// | |
var __vue_script__, __vue_template__; __vue_script__ = (function(){ var _regenerator = require("babel-runtime/regenerator"); | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tell Babel to compile JSX to Preact's form, because we're using Preact for | |
// this app: | |
/** @jsx Preact.createElement */ | |
// pointer events polyfill | |
import 'pepjs' | |
import Preact from 'preact-compat' | |
import TWEEN from 'tween.js' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var infamous=function(t){'use strict';function r(t){return 2===t.length?t[0]*t[0]+t[1]*t[1]:t[0]*t[0]+t[1]*t[1]+t[2]*t[2]}function n(t){return st(r(t))}function o(t){return 0>t?-1:1}function a(t){this.method=t,this._instances=[],this.state=[]}function l(t){this.options=Object.create(l.DEFAULT_OPTIONS),t&&this.setOptions(t),this._startTime=0,this._startValue=0,this._updateTime=0,this._endValue=0,this._curve=void 0,this._duration=0,this._active=!1,this._callback=void 0,this.state=0,this.velocity=void 0}function s(r,n,o){return(1-o)*r+o*n}function d(t){return t instanceof Object?t instanceof Array?t.slice(0):Object.create(t):t}function p(t,r){var n={curve:r.curve};return r.duration&&(n.duration=r.duration),r.speed&&(n.speed=r.speed),t instanceof Object&&(void 0!==t.duration&&(n.duration=t.duration),t.curve&&(n.curve=t.curve),t.speed&&(n.speed=t.speed)),'string'==typeof n.curve&&(n.curve=l.getCurve(n.curve)),n}function c(r,n,o,a,l){var t=1e-7,s=(o(l)-o(l-t))/t,d;if(r instanceof Array){d=[];for(var p=0;p<r.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function performanceTests(...testCases) { | |
const NUM_ITERATIONS = 5000000 | |
let results = [] | |
console.log(' -- Running tests... ') | |
for (let i=0, l=testCases.length; i<l; i+=1) { | |
results.push(testCases[i](NUM_ITERATIONS)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//First attempt: O(r^2) | |
function drawCircle(cx, cy, r) { | |
var dim = 100 | |
for (let i = -r; i<=r; i+=1) { | |
for (let j = -r; j<=r; j+=1) { | |
if ( | |
Math.round(Math.sqrt(i*i + j*j)) === r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Depends on d3.js. | |
// See https://gist.github.com/mbostock/4163057 | |
// Sample the SVG path uniformly with the specified precision. | |
function samples(path, precision) { | |
var n = path.getTotalLength(), t = [0], i = 0, dt = precision; | |
while ((i += dt) < n) t.push(i); | |
t.push(n); | |
return t.map(function(t) { | |
var p = path.getPointAtLength(t), a = [p.x, p.y]; |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.famous = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
/** | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2015 Famous Industries Inc. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this soft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This event emitter emits events, but reserves the right to publish events to | |
// for its creator. It uses a WeakMap for true encapsulation. | |
const eesToEventMaps = new WeakMap(); | |
export default class EventEmitter { | |
constructor(publisher) { | |
const eventMap = Object.create(null); | |
eesToEventMaps.set(this, eventMap); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let propCacheSymbol = Symbol() | |
class MultiClassPrototype { | |
constructor(propCache) { | |
this[propCacheSymbol] = propCache | |
} | |
} | |
// Just an idea: multiple inheritance... | |
// IMPORTANT NOTE: This assumes that the prototype of the classes are not |