Skip to content

Instantly share code, notes, and snippets.

View sboisson's full-sized avatar

Stéphane sboisson

View GitHub Profile
@sboisson
sboisson / ssdp.py
Last active March 21, 2016 18:50 — forked from dankrause/ssdp.py
#!/usr/bin/python
# Copyright 2014 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@sboisson
sboisson / Rx.Observable.cacheWithExpiration-demo.js
Last active August 14, 2017 18:43 — forked from trajakovic/Rx.Observable.cacheWithExpiration-demo.js
RxJs extension implementation for cache results with time expiration
var slowJob = Rx.Observable.defer(function () {
return Rx.Observable.return(Math.random() * 1000).delay(2000);
});
var cached = slowJob.cacheWithExpiration(5000);
var last = Date.now();
function repeat() {
last = Date.now();
cached.subscribe(function (data) {
@sboisson
sboisson / Create_Iframe_Index_M3U8.bash
Created September 24, 2015 13:45 — forked from svagionitis/Create_Iframe_Index_M3U8.bash
Segment an mp4 file to HLS streaming files
#!/bin/bash
# Create an Iframe index from HLS segmented streams
# $1: Filename to be created
# $2: Location of segmented ts files
# Check how many arguments
if [ $# != 2 ]; then
echo "Usage: $0 [Input filename] [Location of segmented streams]"
exit 1;
fi