Skip to content

Instantly share code, notes, and snippets.

View dmitrirussu's full-sized avatar
👻
I may be slow to respond.

Dmitri Russu dmitrirussu

👻
I may be slow to respond.
View GitHub Profile
@dmitrirussu
dmitrirussu / gist:4aee52ca386ad5a37bab
Created November 13, 2015 14:07 — forked from codler/gist:3906826
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');
@dmitrirussu
dmitrirussu / RJson-php.lib.php
Last active December 16, 2015 03:59
PHP5 RJson, RJson converts any Array data collection into more compact recursive form. Compressed data is still JSON and can be parsed with JSON.parse. RJson can compress not only homogeneous collections, but any data sets with free structure.
<?php
/**
PHP5 RJson Version 0.1.1
Copyright (c) 2013, Dmitri Russu <dmitri.russu@gmail.com>
RJson return compact recursive data Array or Object Array by Algorithm Dmytro Dogadailo <entropyhacker@gmail.com>.
RJson converts any Array data collection into more compact recursive
form. Compressed data is still JSON and can be parsed with `JSON.parse`. RJson