Skip to content

Instantly share code, notes, and snippets.

View maxkueng's full-sized avatar
💭
🚴‍♂️

Max Kueng maxkueng

💭
🚴‍♂️
View GitHub Profile
@maxkueng
maxkueng / index.js
Created May 14, 2014 21:27
requirebin sketch
var Victor = require('victor');
var raf = require('raf');
require('mouse');
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
ctx.font = '10px sans-serif';
var v1 = new Victor(200, 200);
var v2 = new Victor(350, 350);
@maxkueng
maxkueng / index.js
Created May 1, 2014 16:59
requirebin sketch
var Promise = require('promise');
var domify = require('domify');
var insertCSS = require('insert-css');
var stage = domify('<div class="stage"><div class="light"></div><div class="road"><div class="crossing"><div></div><div></div><div></div><div></div><div></div></div></div></div>');
var pedestrians = [];
var whenGreen = new Promise(function(resolve) {
setTimeout(function () {
stage.classList.add('green');
resolve();
@maxkueng
maxkueng / index.js
Created May 1, 2014 03:28
requirebin sketch
var whenthen = require('whenthen');
var domify = require('domify');
var insertCSS = require('insert-css');
var stage = domify('<div class="stage"><div class="light"></div><div class="road"><div class="crossing"><div></div><div></div><div></div><div></div><div></div></div></div></div>');
var pedestrians = [];
var whenGreen = whenthen(function (resolve) {
setTimeout(function () {
stage.classList.add('green');
resolve();
@maxkueng
maxkueng / index.js
Created August 24, 2013 09:13
requirebin sketch
var Writable = require('readable-stream/writable'),
Readable = require('readable-stream/readable'),
QueryStream = require('querystream');
// Some sample data
var sampleData = [
{ x : 10, y : 200 },
{ x : 20, y : 190 },
{ x : 30, y : 180 },
{ x : 40, y : 170 },
@maxkueng
maxkueng / example.js
Created July 13, 2013 16:13
readylist
var ready = require('./ready');
var cdCache = {};
function getDiskData (discId) {
cdCache[discId] = cdCache[discId] || ready(function (done) {
setTimeout(function () {
done(Math.random());
}, 2000);
});

Instructions

  1. Download and install Node.js and npm (comes with Node.js)
  2. Download this code
  3. Change to the directory where the source code is (with a terminal)
  4. Type npm install to install module dependencies
  5. Edit app.js and edit the "settings" section
  6. Run the app by typing node app.js
@maxkueng
maxkueng / index.html
Created July 19, 2012 11:44
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CodePen &middot; A Pen by maxkueng</title>
<!--
Copyright (c) 2012 Max Kueng, http://codepen.io/maxkueng
Permission is hereby granted, free of charge, to any person obtaining
@maxkueng
maxkueng / index.html
Created July 19, 2012 11:44
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CodePen &middot; A Pen by maxkueng</title>
<!--
Copyright (c) 2012 Max Kueng, http://codepen.io/maxkueng
Permission is hereby granted, free of charge, to any person obtaining