Skip to content

Instantly share code, notes, and snippets.


Juho Vepsäläinen bebraw

View GitHub Profile
View TextField.js
/* @flow */
import React, { Component } from 'react';
import Ruler from '../Ruler/Ruler.jsx';
type Style = {
textColor?: string;
floatingLabelColor?: string;
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 / hermite.js
Last active Dec 26, 2015
Arbitrary hermite curve thingy for Canvas.
View hermite.js
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));
bebraw /
Created Dec 12, 2015
Most active GitHub users in Finland (2015)

Most active GitHub users in Finland (

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at from Fri, 12 Dec 2014 12:29:07 GMT till Sat, 12 Dec 2015 12:29:07 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

  .filter(user => user.followers > 12)
bebraw / compile_plugin.js
Created Jun 28, 2013
Generic compiler plugin for james.js.
View compile_plugin.js
var james = require('james');
module.exports = function(options) {
return james.createStream(function(file, callback) {
callback(options.compiler.compile(file, options)(options.context));
bebraw / notify.js
Created Jun 22, 2013
Pipe to OS X notifier. Requires and . You can install latter through MacPorts (port install terminal-notifier). Usage: foo | ./notify.js
View notify.js
#!/usr/bin/env node
var notifier = require('node-notifier');
var stdin = process.openStdin();
stdin.on('data', function(chunk) {
notifier.notify({message: chunk});
View gist:5719262
$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=55 time=31.281 ms
64 bytes from icmp_seq=1 ttl=55 time=29.416 ms
64 bytes from icmp_seq=2 ttl=55 time=31.258 ms
64 bytes from icmp_seq=3 ttl=55 time=28.973 ms
64 bytes from icmp_seq=4 ttl=55 time=28.925 ms
64 bytes from icmp_seq=5 ttl=55 time=31.554 ms
64 bytes from icmp_seq=6 ttl=55 time=31.247 ms
64 bytes from icmp_seq=7 ttl=55 time=34.498 ms
View transparency_demo.js
var context, directives;
context = {
"header": "Colors",
"items": [
{"name": "red", "first": true, "url": "#Red"},
{"name": "green", "link": true, "url": "#Green"},
{"name": "blue", "link": true, "url": "#Blue"}
"empty": false
View transparency_markup.jade
View data.json
"header": "Colors",
"items": [
{"name": "red", "first": true, "url": "#Red"},
{"name": "green", "link": true, "url": "#Green"},
{"name": "blue", "link": true, "url": "#Blue"}
"empty": false