Skip to content

Instantly share code, notes, and snippets.

1.)
Sent
```{"data":[{"mediaProviders":["WebRTC"],"appKey":"defaultApp","clientVersion":"2.0","clientOSVersion":"5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit\/605.1.15 (KHTML, like Gecko) Mobile\/15E148 Safari\/604.1","msePacketizationVersion":2,"clientBrowserVersion":"Mozilla\/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/16.1 Mobile\/15E148 Safari\/604.1"}],"message":"connection"}```
Received
```{"message":"getUserData","data":[{"useWsTunnel":false,"useWsTunnelPacketization2":false,"msePacketizationVersion":2,"useBase64BinaryEncoding":false,"mediaProviders":["WebRTC"],"authToken":"359d7a53-3372-409e-8850-24dd7d55efd1","status":"ESTABLISHED","clientVersion":"2.0","clientOSVersion":"5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Safari/604.1","clientBrowserVersion":"Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Mobile/15E148 Sa
@niorko
niorko / ActivityIndicator.swift
Created February 8, 2018 11:33
ActivityIndicator.swift
/**
Enables monitoring of sequence computation.
If there is at least one sequence computation in progress, `true` will be sent.
When all activities complete `false` will be sent.
*/
class ActivityIndicator : DriverConvertibleType {
typealias E = Bool
fileprivate let _lock = NSRecursiveLock()
fileprivate let _variable = Variable(0)
@niorko
niorko / vibe-pseudo.c
Created February 7, 2018 09:36
ViBe C like gist
// fixed parameters for ViBe
// number of samples per pixel
Int N=20;
// radius of the sphere
Int R=20;
// number of close samples for being
@niorko
niorko / sample.java
Last active December 10, 2016 13:26
/**
* Generic implementation of getting item from DB
*
* @param query SQL query
* @param mapper mapper that map {@link ResultSet} T object
* @param queryArguments callback for filling query arguments
* @param <T> POJO
* @return parsed instance of T
* @throws SQLException classic sql exception
* @throws IOException in case of uploading file
@niorko
niorko / itoa.c
Created February 2, 2016 12:59
Alternative to sprintf for pebble SDK (no need for stdio.h)
char *itoa(int num)
{
static char buff[20] = {};
int i = 0, temp_num = num, length = 0;
char *string = buff;
if (num >= 0) {
while(temp_num) {
temp_num /= 10;
length++;