Skip to content

Instantly share code, notes, and snippets.

View valentinvichnal's full-sized avatar

Valentin Vichnal valentinvichnal

View GitHub Profile
'use strict';
import {Actions} from "react-native-router-flux";
// var Sinch = require('./Sinch-javascript/sinch-rtc')
import Camera from 'react-native-camera';
var GiftedMessenger = require('react-native-gifted-messenger');
var GiftedSpinner = require('react-native-gifted-spinner');
var React = require('react-native');
const timer = require('react-native-timer');
var {
AppRegistry,
@valentinvichnal
valentinvichnal / howto_nat_traversal.md
Created August 1, 2016 12:47 — forked from mildred/howto_nat_traversal.md
How To TCP NAT Traversal using Node.js and a STUN Server

How To TCP NAT Traversal using Node.js and a STUN Server

With the scarecity of IPv4 addresses, and IPv6 still not available at large, NAT traversal is becoming a necessity. Especially with the generalisation of Carrier-grade NATs that you can find on mobile connections. Even with IPv6 you may suffer NAT66. Imagine your mobile device that gets only a single Ipv6 address, and you want to share it on your computer.

The solution might be in a decentralized protocol for address attribution such

@valentinvichnal
valentinvichnal / haproxy.cfg
Created August 1, 2016 12:54
Here's a sample WORKING haproxy config for websockets / socketio. We were able to get socketio working on an Amazon ELB with just one node, but when we added multiple nodes, we saw weird client issues. So, we decided to use HAProxy on Ubuntu 12.04 and spent significant time trying to get just the right configuration (haproxy.cfg). Note though th…
global
#debug
#daemon
log 127.0.0.1 local0
defaults
log global
option httplog
frontend unsecured *:80
@valentinvichnal
valentinvichnal / index.html
Created August 2, 2016 21:43 — forked from gustavo-sdo/index.html
A CodePen by AKM2. Lightning - http://jsdo.it/akm2/pQbM
<canvas id='c'></canvas>
@valentinvichnal
valentinvichnal / byte-sizetuts.md
Created August 16, 2016 16:55 — forked from honkskillet/byte-sizetuts.md
A series of golang tutorials with youtube videos.
@valentinvichnal
valentinvichnal / nginx.conf
Created August 18, 2016 19:30 — forked from dnprock/nginx.conf
meteor nginx load balance with sticky session, used by vida.io
# Sticky session module for nginx
# https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/
# nginx configure command: ./configure --with-http_ssl_module --add-module=../nginx-sticky-module-ng/ --sbin-path=/usr/local/sbin --with-http_gzip_static_module
upstream vida_node_server {
sticky path=/;
server 127.0.0.1:3000 max_fails=3 fail_timeout=30s;
server [server2]:3000 max_fails=3 fail_timeout=30s;
}
@valentinvichnal
valentinvichnal / nginx.conf
Created August 18, 2016 20:35 — forked from fightingtheboss/nginx.conf
Nginx configuration file for private VPN deployment of a Meteor app with HAProxy handling load balancing
upstream haproxy {
server 127.0.0.1:9000;
}
upstream stats {
server 127.0.0.1:9999;
}
server {
listen 80; ## listen for ipv4; this line is default and implied
@valentinvichnal
valentinvichnal / haproxy.cfg
Created August 18, 2016 20:35 — forked from fightingtheboss/haproxy.cfg
HAProxy configuration file for deploying Meteor application to private VPN. Fronted by nginx for static assets, backed by multiple app instances. See https://gist.github.com/fightingtheboss/5843323 for Nginx setup.
global
daemon
defaults
mode http
timeout connect 86400000
timeout server 86400000
timeout client 86400000
timeout check 5s
@valentinvichnal
valentinvichnal / phoenix showdown rackspace onmetal io.md
Created September 23, 2016 13:53 — forked from omnibs/phoenix showdown rackspace onmetal io.md
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
@valentinvichnal
valentinvichnal / chatServer.js
Created September 24, 2016 21:10 — forked from creationix/chatServer.js
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client