Skip to content

Instantly share code, notes, and snippets.

View nulltask's full-sized avatar

Seiya KONNO nulltask

View GitHub Profile
@nulltask
nulltask / index.js
Created July 3, 2014 11:52
Forward events to socket.io namespace.
var Emitter = require('events').EventEmitter;
var emitter = new Emitter();
var io = require('socket.io')();
var fwd = require('forward-events');
var nsp = io.of('/what-time-is-it');
fwd(emitter, nsp);
setInterval(function() {
if (a) a.stop();
console.time('create');
a = context.createBufferSource();
a.buffer = buffers[(Math.random() * buffers.length) | 0];
a.connect(context.destination);
console.timeEnd('create');
a.noteOn(0);
create: 0.068ms
[
{
"activity": "aerobics",
"geo": false,
"place": true,
"color": "bc4fff",
"units": "duration,calories"
},
{
up
install coreutils
install ffmpeg
install rbenv
install ruby-build
install rbenv-gemset
var audio = new Audio();
audio.src = '/path/to/audio.wav';
function play() {
audio.pause();
audio.currentTime = 0;
audio.play();
}
$ time ./script/bootstrap.py
real 5m14.329s
user 1m22.303s
sys 0m37.695s
$ time ./script/build.py
ninja: Entering directory `out/Release'
[1010/1010] STAMP Atom.app
ninja: Entering directory `out/Debug'
<!doctype html>
<html>
<body>
<script>
var worker = new Worker('./worker.js');
worker.onmessage = function(e) {
console.log(e.data);
};
</script>
$ time vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'precise64'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vagrant-rails_default_1397616077541_57517
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
source 'https://rubygems.org'
gem 'rsvg2'
#<UserAgent:0x007fb6521be6e8 @product="Mozilla", @version=#<UserAgent::Version 5.0>, @comment=["Linux", "U", "Android 4.0.3", "ja-jp", "ISW13F Build/V77R60B"]>, #<UserAgent:0x007fb6521b77f8 @product="AppleWebKit", @version=#<UserAgent::Version 534.30>, @comment=["KHTML, like Gecko"]>, #<UserAgent:0x007fb6521b6088 @product="Version", @version=#<UserAgent::Version 4.0>, @comment=nil>, #<UserAgent:0x007fb6521b5340 @product="Mobile", @version=nil, @comment=nil>, #<UserAgent:0x007fb6521b4f80 @product="Safari", @version=#<UserAgent::Version 534.30>, @comment=nil>