Skip to content

Instantly share code, notes, and snippets.

i = 10
d = [0...i]
[1.3]
[1..3]
[1...3]
[1....3]
fun
fun()
fun 1
fun(1)
fun;
fun();
fun(1);
fun(1);
console.log(a + b + c)
console.log(a +b + c)
@majek
majek / test1.erl
Created January 27, 2012 12:18
SockJS-erlang cowboy api proposal (simple)
-module(test1).
-export([start/0]).
%% Cowboy callbacks
-export([init/3, handle/2, terminate/2]).
start() ->
Port = 8081,
application:start(sockjs),
@majek
majek / test2.erl
Created January 27, 2012 12:19
SockJS-erlang cowboy api proposal (advanced)
-module(test2).
-export([start/0]).
%% Cowboy callbacks
-export([init/3, handle/2, terminate/2]).
start() ->
Port = 8081,
application:start(sockjs),
@majek
majek / client-direct.js
Created February 1, 2012 13:18
faye-bug-13
var net = require('net');
console.log(" [.] Connecting to localhost:8000");
var conn = net.createConnection(8000, '127.0.0.1');
var data = [
"GET /echo/1/1/websocket HTTP/1.1",
"Upgrade: WebSocket",
"Connection: Upgrade",
@majek
majek / cowboy_http10_bug.erl
Created February 7, 2012 16:39
cowboy http/1.0 bug
#!/usr/bin/env escript
%%! -smp disable +A1 +K true -pz ./ebin -pa deps/cowboy/ebin -input
-module(cowboy_http10_bug).
-mode(compile).
-export([main/1]).
%% Cowboy callbacks
-export([init/3, handle/2, terminate/2]).
@majek
majek / client-direct.js
Created February 9, 2012 15:51
Misultin haproxy websocket hixie76 bug
var net = require('net');
console.log(" [.] Connecting to localhost:8000");
var conn = net.createConnection(8000, '127.0.0.1');
var data = [
"GET /echo/1/1/websocket HTTP/1.1",
"Upgrade: WebSocket",
"Connection: Upgrade",