Skip to content

Instantly share code, notes, and snippets.

View karboom's full-sized avatar

赵健 karboom

  • 杭州电子科技大学
View GitHub Profile
@ranacseruet
ranacseruet / VideoStream.php
Last active October 30, 2024 12:43
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@oroce
oroce / bunyan-pipe-to-mongodb.js
Created November 10, 2012 21:29
pipe bunyan logger into mongodb (even with node-restify)
var mongoCol = require( "mongo-col" ),
mongoStream = require( "mongo-stream" ),
mongoInsertStream = mongoStream( mongoCol( "piped-collection", null, {
dbOptions:{
safe: true
}
})),
Logger = require( "bunyan" );
new Logger({
@tystr
tystr / alias.php
Last active December 22, 2015 02:34
PHP Implementation of Vose's Alias Method
<?php
/**
* Implementation of Vose's Alias Method
*
* @param array $probabilities An array of probabilities
*
* @return int
*/
public function aliasMethod(array $probabilities)
{