Skip to content

Instantly share code, notes, and snippets.

View dongido001's full-sized avatar
🕳️
../

Onwuka Gideon dongido001

🕳️
../
View GitHub Profile
@karx
karx / kaaroStream-Twitch.js
Created October 11, 2019 09:09
HTML Canvas - Record and stream to Twitch.tv | Used along with a server instance with ffmpeg https://github.com/karx/kaaroStream-bridge
let kaaro_stream_bridge_url = "boomboom.store:3012";
let stream_key = '<twitch_streaming_key>';
let mediaRecorder;
let mediaStream;
let ws_url = window.location.protocol.replace('http', 'ws') + '//' + // http: => ws:, https: -> wss:
kaaro_stream_bridge_url +
'/rtmp/' +
encodeURIComponent(`rtmp://live-sin.twitch.tv/app/${stream_key}`);
@josephkern
josephkern / bloom.py
Created June 8, 2012 19:04
A Simple Bloom Filter in Python
#!/usr/bin/env python
"""A simple Bloom Filter implementation
Calculating optimal filter size:
Where:
m is: self.bitcount (how many bits in self.filter)
n is: the number of expected values added to self.filter
k is: the number of hashes being produced
(1 - math.exp(-float(k * n) / m)) ** k
http://en.wikipedia.org/wiki/Bloom_filter
"""