Skip to content

Instantly share code, notes, and snippets.

View kamicane's full-sized avatar

Valerio Proietti kamicane

View GitHub Profile
"use strict";
var fragmentText = function(ctx, lines, index, maxWidth) {
var line = lines[index];
var nextLine;
var tooLong = true;
while (tooLong) {
var width = ctx.measureText(line.join(" ")).width;
@kamicane
kamicane / .requirebin-equation-stuff-2
Last active January 12, 2017 09:55
requirebin sketch
another requirebin equation-designer early demo
@kamicane
kamicane / README.md
Last active May 23, 2019 02:30
[cubic-bezier-solver]

a cubic-bezier solver.

@kamicane
kamicane / .projected-vertices
Last active January 12, 2017 09:58
requirebin sketch
an old test on 3d projections of vertices onto the screen
@kamicane
kamicane / unmatrix2d.js
Created April 7, 2012 14:45
Unmatrix 2d - from pseudo code to non working javascript!
/*
Unmatrix 2d
- a crude implementation of the slightly bugged pseudo code in http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition
*/"use strict"
// returns the length of the passed vector
var length = function(a){
return Math.sqrt(a[0] * a[0] + a[1] * a[1])
}
// Array shuffle for MooTools
Array.implement({
shuffle: function(){
var i = this.length;
if (i == 0) return;
while (--i){
var j = Math.floor(Math.random() * ( i + 1 ));
var tempi = this[i];

MooTools 1.3dev CheatSheet

Legend

Object:method

method is a prototype of Object

Object.method