Skip to content

Instantly share code, notes, and snippets.

@iizukanao
iizukanao / server.coffee
Created Dec 5, 2016
Accept streaming if ?stream_key=xxxx is present
View server.coffee
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 Mar 24, 2016
Example code for npm module "node-rtsp-rtmp-server"
View server.js
var StreamServer = require('node-rtsp-rtmp-server');
var server = new StreamServer;
server.start();
View keybase.md

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 Aug 29, 2015
Live streaming while avoiding accumulating delay (replace YOUR_HOST with server's address)
View index.html
<!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 Aug 29, 2015
setTimeout issues on Node v0.10.30
View hang.js
var counter = 0;
function queueNext() {
if (++counter === 100) {
return;
}
console.log(counter);
setTimeout(function() {
queueNext();
}, 12.34);
@iizukanao
iizukanao / ranges.rb
Last active Dec 14, 2015
Extract F and W ranges from EastAsianWidth.txt (http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt)
View ranges.rb
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 Aug 24, 2011
Simple HTTP server
View server.js
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");
View gist:1103592
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 Jul 15, 2011
growlnotify over UDP
View growlnotify
#!/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 Jun 6, 2011
let ack search *.mt, *.txt, and *.coffee
View .ackrc
--type-set
coffeescript=.coffee
--type-add
html=.mt,text=.txt,coffeescript=.coffee