This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(pecypc_session). | |
-author('Vladimir Dronnikov <[email protected]>'). | |
-include_lib("stdlib/include/qlc.hrl"). | |
%% ----------------------------------------------------------------------------- | |
%% API exports | |
%% ----------------------------------------------------------------------------- | |
-export([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
# windows | |
if test "x$USERPROFILE" != x; then | |
DIRSEP=';' | |
ERL='start werl' | |
# *nix | |
else | |
DIRSEP=':' | |
ERL=erl | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code:load_abs(os:getenv("HOME") ++ "/.ebin/user_default"), | |
io:format("You may use r() to recompile the code, t() to recompile templates under priv/templates.~n", []). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-spec user_agent_platform(binary()) -> undefined | atom(). | |
user_agent_platform(Header) -> | |
user_agent(cowboy_bstr:to_lower(Header), [ | |
{<<"windows">>, windows}, | |
{<<"linux">>, linux}, | |
{<<"os x ">>, osx}, | |
{<<"android">>, android}, | |
{<<"ipod">>, ipod}, | |
{<<"iphone">>, iphone}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% | |
%% @doc Generic process registrar and operating primitives. | |
%% Basically, gproc wrapper. | |
%% | |
-module(peectp). | |
-author('Vladimir Dronnikov <[email protected]>'). | |
%% | |
%% ----------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(handler). | |
-author('Vladimir Dronnikov <[email protected]>'). | |
-define(INFO, error_logger:info_report). | |
-define(ERROR, error_logger:error_report). | |
%% | |
%% ------------------------------------------------------------------ | |
%% cowboy HTTP handler API | |
%% ------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latest moonslice-luv hello world: | |
[dvv@dvv take6]$ wrk -c20k -r1000k http://localhost:8080/greet | |
Making 1000000 requests to http://localhost:8080/greet | |
2 threads and 20000 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 268.44ms 334.12ms 2.37s 81.42% | |
Req/Sec 6.51k 1.99k 8.00k 88.55% | |
1000160 requests in 1.02m, 132.58MB read | |
Socket errors: connect 0, read 8774, write 0, timeout 257854 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env luajit2 | |
local Util = require('utils') | |
local p = Util.prettyPrint | |
local resolve | |
do | |
local ffi = require('ffi') | |
local C = ffi.C | |
ffi.cdef[[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is, isnt | |
==== | |
is, isnt ---> ==, ~= | |
else if | |
==== | |
if 1 | |
p(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
Install https://github.com/luvit/luvm | |
It's basically creationix/nvm ported to luvit. | |
The only change is the absence of 'v' prefix for versions. I found it redundant. | |
Nothing surprising should happen, it should require nothing beyond build-essentials. | |
So after vanilla sourcing luvm with `cd ~/.luvm ; . luvm.sh` and running `luvm install 0.1.4` you should have on the PATH: | |
- luvit binary | |
- lui: headless dependency fulfiller | |
- luvit-config: a pkg-config surrogate |