Skip to content

Instantly share code, notes, and snippets.

Avatar

Juho Vepsäläinen bebraw

View GitHub Profile
View dev-server.js
'use strict';
var express = require('express');
var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var config = require('./config/webpack.config');
main();
View gradient_animation.js
main();
function main() {
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext('2d');
animate(function(i) {
var matrix = generateMatrix(20, 20, function(x, y, xlen, ylen) {
var fac = fromBoundToBound(0, 1, i / 2000);
var a = 200000;
View lattice_gradient.js
main();
function main() {
var canvas = document.getElementById("canvas");
latticeGradient(canvas, [
[[1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 1], [1, 0, 0, 1]],
[[0, 1, 0, 1], [0, 0, 1, 1], [1, 0, 0, 1], [0, 1, 0, 1]],
[[0, 0, 1, 1], [1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 1]],
[[1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 1], [1, 0, 0, 1]]
View rectangle_gradient.js
main();
function main() {
var canvas = document.getElementById('canvas');
quadGradient(canvas, {
topLeft: [1, 0, 1, 1],
topRight: [0, 0, 0, 1],
bottomLeft: [0, 1, 0, 1],
bottomRight: [0, 1, 1, 1]
View send.js
#!/usr/bin/env node
'use strict';
var PORT = 9909;
var HOST = '172.18.12.2';
var LIGHTS = 36;
var dgram = require('dgram');
View stiff_manifesto.md

Manifesto for Stiff Software Development

We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value:

  • Processes and tools over individuals and interactions
  • Comprehensive documentation over working software
  • Contract negotiation over customer collaboration
  • Following a plan over responding to change

That is, while there is value in the items on the right, we value the items on the left more.

@bebraw
bebraw / vec.js
Created Oct 25, 2013
Simple, generic Vector thinger for JS. Just basic ops.
View vec.js
var Vec = decorate({
add: function(a, b) {return a + b;},
sub: function(a, b) {return a - b;},
div: function(a, b) {return a / b;},
mul: function(a, b) {return a * b;}
}, function(op) {
return function() {
var pos = arguments[0].slice();
var i, len, arg;
@bebraw
bebraw / hermite.js
Last active Dec 26, 2015
Arbitrary hermite curve thingy for Canvas.
View hermite.js
$(main);
function main() {
var $c = $('#demo');
var ctx = $c[0].getContext('2d');
ctx.translate(0, $c.height());
ctx.scale(1, -1);
var points = [[0, 0], [55, 43], [94, 226], [255, 255]];
drawCurve(ctx, hermite(points));
You can’t perform that action at this time.