Skip to content

Instantly share code, notes, and snippets.

@vunb
vunb / gist:eb0c18bcc822c47ca999
Created January 22, 2016 03:53 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@vunb
vunb / static_server.js
Last active January 15, 2016 15:12 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@vunb
vunb / nginx.conf
Created January 1, 2016 14:12 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
According to the thread pointed out by Gianni, to turn off echo cancellation, you'd want a media constraint that looked like:
{ audio: { optional: [{ your options }] } }
Looking at the easyrtc code, you should be able to do
easyrtc.enableAudio({ optional: [{ your options }]});
And expect that to be passed down to getUserMedia. It's not a documented use, but the enableAudio doesn't do a !! on the argument to force it to boolean (which it probably should have).
However, the thread mentions that as happening in version 37, while production version is 25. So I wouldn't expect it to work anywhere except in Canary.
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@vunb
vunb / timeago.directive.js
Last active August 29, 2015 14:14 — forked from rodyhaddad/timeago.filter.js
timeago filter and timeago directive with update automatically !
.directive('timeago',
[
'$timeout',
'$filter',
function($timeout, $filter) {
return function(scope, element, attrs) {
var time = parseInt(attrs.timeago) || new Date().getTime();
var intervalLength = 1000 * 10; // 10 seconds
var filter = $filter('timeago');
@vunb
vunb / index.js
Last active August 29, 2015 14:14 — forked from chamerling/index.js
'use strict';
var easyrtc = require('easyrtc');
var config = require('../core').config('default');
var server = {
started: false,
pub: null
};
exports = module.exports = server;
@vunb
vunb / ejb client InitialContext.java
Created January 8, 2015 07:58
Những lỗi gặp phải với Ejb
Properties props = new Properties();
props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost"); // default!
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700"); // default!
InitialContext context = new InitialContext(props);
VendorFacadeRemote remote = (VendorFacadeRemote) context.lookup("java:global/ConfigDb-Ejb/VendorFacade");
@vunb
vunb / README.md
Last active August 29, 2015 14:08 — forked from 8bitDesigner/README.md

Simple Static file server

Handy for when working on single-page apps

Usage

  1. npm install -g server-here
  2. here (if you're in a folder with files you want to serve)

Options

here --dir [directory to load files from] --port [port to use]

@vunb
vunb / stuns
Last active August 29, 2015 14:08 — forked from zziuni/stuns
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net