Skip to content

Instantly share code, notes, and snippets.

View flavioribeiro's full-sized avatar
:octocat:

Flavio Ribeiro flavioribeiro

:octocat:
View GitHub Profile
@flavioribeiro
flavioribeiro / .babelrc
Created April 3, 2018 18:26 — forked from thejmazz/.babelrc
async/await with webpack+babel
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
{
"streams": [
"eiplus": {
"input-path": "/live-stream-secure/5801255b39c38e1109ddfabd/publish/media_2500.m3u8?dnt=true&access_token=8UchcOwh4X0fsaceGvovudlTmr1XfIx8Y6o7V2W8Uu20cBpqnysoOa35lIrL48CXD5NjnspExCB&ref=https%3A%2F%2Fwww.eiplus.com.br%2Fcanal%2F45%2Fconexao-ei-ao-vivo%2F&es=vrzn-ei-ee.cdn.mdstrm.com&proto=https",
"servers": ["https://vrzn-ei-ee.cdn.mdstrm.com"],
}
]
}
protected function decode(str:String):ByteArray
{
var alphabet:String = 'abcdefghijklmnopqrstuvwxyz'; // only first 16 chars used
var lookup:Object = new Object;
var len:Number = str.length;
var enc:Array = [0,0];
var result:ByteArray = new ByteArray;
if(str.length % 2)
throw new Error("Decode failed: The string is not correctly encoded.");
var position:Number = -1;
{
"streams": {
"Nasa-high": {
"input-path": "/stream/stream716/playlist.m3u8",
"servers": ["http://segmenter.live.hls.qa01.globoi.com/"],
"bandwidth": 1080434
}
},
"actions": [
@flavioribeiro
flavioribeiro / hlsclient_input_v2.json
Created November 5, 2012 18:57 — forked from hltbra/hlsclient_input_v2.json
New input JSON for hlsclient
{
"streams": {
"Nasa-low": {
"input-path": "/msfc/Edge.m3u8",
"output-path": "/nasa/Edge.m3u8",
"servers": ["http://liveips.nasa.gov.edgesuite.net"],
"bandwidth": 254082
},
"Nasa-medium": {
"input-path": "/msfc/3G.m3u8",
@flavioribeiro
flavioribeiro / compose.py
Created October 4, 2012 14:59 — forked from jbochi/compose.py
function composition in python
class O():
def __repr__(self):
return "<" + ' *o* '.join(map(repr, self.funs)) + ">" if self.funs else "<composer>"
def __init__(self, funs=None):
self.funs = funs if funs else []
def __rmul__(self, other):
other_funs = other.funs if isinstance(other, O) else [other]
return O(other_funs + self.funs)
@flavioribeiro
flavioribeiro / gist:3334526
Created August 12, 2012 21:16 — forked from jbochi/gist:3331737
Fibonnaci in C for dailykata.net
// just a small mod in @jbochi's solution
#include <stdio.h>;
int fib(int n) {
if (n < 2) {
return n;
} else {
return fib(n - 1) + fib(n - 2);
}