Skip to content

Instantly share code, notes, and snippets.

var constraints = {
audio: false,
video: {
width: { min: 1024, ideal: 1280, max: 1920 },
height: { min: 576, ideal: 720, max: 1080 },
}
};
https://stackoverflow.com/questions/28282385/webrtc-firefox-constraints/28911694#28911694
@StasKoval
StasKoval / common.yml
Created February 2, 2016 18:14 — forked from akurkin/common.yml
ROSI docker-compose.yml
#
# Shared definition of ruby microservice
#
microservice:
command: "runsvdir /etc/service"
environment:
PORT: 3000
RAILS_ENV: development
SERVICE_PLATFORM: "mia"
ports:
@StasKoval
StasKoval / README.md
Created February 4, 2016 22:37
Kurento Media Server Installation (Debian Wheezy 64bit)

NOTE: This guide is currently incomplete.

Install general dependencies:

sudo apt-get install git build-essential cmake pkg-config libboost-dev libboost-test-dev \
     libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config \
     libssl-dev libsoup2.4-dev libboost-system-dev libboost-filesystem-dev \
     libogg-dev libtheora-dev libasound2-dev libvorbis-dev libpango1.0-dev \
     libvisual-0.4-dev libffi-dev libgmp-dev
@StasKoval
StasKoval / rpc_consumer.rb
Created February 27, 2016 07:14 — forked from gaffneyc/rpc_consumer.rb
Basic RPC using RabbitMQ and Bunny
require 'rubygems'
gem 'gaffneyc-bunny'
require 'bunny'
# Example of simple RPC using server named queues
Bunny.open do |amqp|
# Exchange definition
amqp.exchange('reply', :type => :direct)
amqp.exchange('out', :type => :direct)
@StasKoval
StasKoval / reconnect.js
Created March 2, 2016 04:35 — forked from carlhoerberg/reconnect.js
How to build reconnect logic for amqplib
var amqp = require('amqplib/callback_api');
// if the connection is closed or fails to be established at all, we will reconnect
var amqpConn = null;
function start() {
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) {
if (err) {
console.error("[AMQP]", err.message);
return setTimeout(start, 1000);
}
@StasKoval
StasKoval / pubsub
Created March 2, 2016 20:46 — forked from jarrettmeyer/pubsub
pubsub with NodeJS and AMQPLib
#!/usr/bin/env node
//
// Example of publisher/subscriber pattern in NodeJS, with AMQPLib. This program has been
// demonstrated to work with 500k messages and 4 subscribers.
//
// #WorksOnMyMachine
//
// Usage: ./pubsub
//
class AuthenticateUser
attr_accessor :user
def initialize(authorization_code)
@authorization_code = authorization_code
end
def perform
token = app_client.exchange_code_for_token(@authorization_code)
user_data = user_client(token).user
@StasKoval
StasKoval / maybe.traceur
Created March 29, 2016 04:09 — forked from torgeir/maybe.traceur
An es6 js maybe monad, using generators
log = console.log.bind(console);
maybe = v => {
function * f () {
if (v) yield v;
}
f.bind = f =>
v ? f(v) : maybe();
@StasKoval
StasKoval / gist:7af0c5af3e619da45702
Created March 29, 2016 15:09 — forked from shovon/gist:5685073d03829f3b63d0
Haskell-style monads in JavaScript (ES6).
'use strict';
class Monad {
constructor(a) { this._value = a; }
'>>='(f) { return f(this.value()); }
static create(a) { return new Monad(a); }
value() { return this._value; }
}
var val = Monad.create(10) ['>>=']
"use strict";
const R = require('ramda');
const app = require('express')();
const Maybe = require('monet').Maybe;
const Left = require('monet').Left;
const Right = require('monet').Right;