Skip to content

Instantly share code, notes, and snippets.

@iizukanao
iizukanao / server.coffee
Created December 5, 2016 12:06
Accept streaming if ?stream_key=xxxx is present
url = require 'url'
config = require './config'
StreamServer = require './stream_server'
Bits = require './bits'
logger = require './logger'
Bits.set_warning_fatal true
logger.setLevel logger.LEVEL_INFO
@iizukanao
iizukanao / server.js
Created March 24, 2016 21:38
Example code for npm module "node-rtsp-rtmp-server"
var StreamServer = require('node-rtsp-rtmp-server');
var server = new StreamServer;
server.start();

Keybase proof

I hereby claim:

  • I am iizukanao on github.
  • I am iizukanao (https://keybase.io/iizukanao) on keybase.
  • I have a public key whose fingerprint is 5BDB 1C5A CD96 E31E C52B 6D44 2F55 F78B 6D3C 88E3

To claim this, I am signing this object:

@iizukanao
iizukanao / index.html
Last active August 29, 2015 14:05
Live streaming while avoiding accumulating delay (replace YOUR_HOST with server's address)
<!doctype html>
<head>
<title>Live streaming with Strobe Media Playback</title>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, user-scalable=no">
</head>
<body>
<script src="lib/swfobject.js"></script>
<script src="lib/ParsedQueryString.js"></script>
@iizukanao
iizukanao / hang.js
Last active August 29, 2015 14:05
setTimeout issues on Node v0.10.30
var counter = 0;
function queueNext() {
if (++counter === 100) {
return;
}
console.log(counter);
setTimeout(function() {
queueNext();
}, 12.34);
@iizukanao
iizukanao / ranges.rb
Last active December 14, 2015 21:49
Extract F and W ranges from EastAsianWidth.txt (http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt)
is_continuous = false
start_code = nil
last_code = nil
File.open("EastAsianWidth.txt").each do |line|
if !(/^\s*#/ =~ line) and !(/^\s*$/ =~ line)
if /^([^;]+);(\S+)/ =~ line
if $2.index 'W' or $2.index 'F'
if not is_continuous
start_code = $1
@iizukanao
iizukanao / server.js
Created August 24, 2011 10:43
Simple HTTP server
var http = require('http');
function onRequest(req, res) {
console.log("onRequest");
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello, World\n");
}
var server = http.createServer(onRequest);
server.listen(1337, "127.0.0.1");
fib = (n) ->
throw new Error "n must be positive integer" if n < 0
switch n
when 0 then 0
when 1 then 1
else
fib(n-1) + fib(n-2)
@iizukanao
iizukanao / growlnotify
Created July 15, 2011 09:59
growlnotify over UDP
#!/usr/bin/env perl
use strict;
use warnings;
use Net::GrowlClient;
use Getopt::Long::Descriptive;
my ($opt, $usage) = describe_options(
`basename $0`." %o",
[ "name|n:s", "Set the name of the application that sends the notification", {default => "growlnotify"} ],
[ "priority|p:i", "Specify an int or named key", {default => 0}, ],
@iizukanao
iizukanao / .ackrc
Created June 6, 2011 13:21
let ack search *.mt, *.txt, and *.coffee
--type-set
coffeescript=.coffee
--type-add
html=.mt,text=.txt,coffeescript=.coffee