Skip to content

Instantly share code, notes, and snippets.

View rafis's full-sized avatar
💭
I may be slow to respond.

rafis

💭
I may be slow to respond.
View GitHub Profile
mtype { LOAD_TASK, TASK_READY, TASK_COMPLETE, HELO_CLIENT, START_CAPABILITY, CAPABILITY_INPUT, CAPABILITY_OUTPUT, CAPABILITY_COMPLETE };
mtype { READY, COMPLETE };
chan taskBus = [128] of { mtype };
active proctype TaskClient() {
taskBus ! LOAD_TASK;
if
:: taskBus ? TASK_READY ->
taskBus ? HELO_CLIENT;
:: taskBus ? HELO_CLIENT ->
@rafis
rafis / compiling-phantomjs-on-raspberry-pi.txt
Created March 9, 2017 10:44
Compiling Phantomjs on Raspberry Pi
There is an excellent article about compiling Phantomjs on Raspberry Pi 2:
http://raspberrypimaker.com/how-to-compile-phantomjs-on-the-raspberry-pi-2
But I would like to emphasize attention on one part which is RAM usage. RAM usage of cc1plus on this project is really huge. If you will
compile with `./build.py --jobs=N` where N is greater or equal 2 then you will propably run into issues:
g++ -c -Wall -Wextra -Wreturn-type -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -pipe -ffunction-sections -fdata-sections -fno-strict-aliasing -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -D_REENTRANT -MMD -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_GRAPHICSVIEW -DQT_NO_GRAPHICSEFFECT -DQT_NO_STYLESHEET -DQT_NO_STYLE_CDE -DQT_NO_STYLE_CLEANLOOKS -DQT_NO_STYLE_MOTIF -DQT_NO_STYLE_PLASTIQUE -DQT_NO_PRINTPREVIEWDIALOG -DBUILDING_QT__=1 -
@rafis
rafis / wsapi.fcgi
Last active December 25, 2015 06:59
This is unrolled version of wsapi.fcgi, so the only dependency is `lfcgi`. Beware! Unlike WSAPI in this implementation call to app.run assumes that it returns a string as third parameter, not an iterator. I have renamed it to `body` from `res_iter`. Also there is MobDebug (something like analog of Zend XDebug) being included and logging to `wsap…
#!/usr/bin/env luajit
local jit = rawget(_G or _ENV, "jit")
--#if ENV ~= "PRODUCTION" then
jit.off(true, true)
--#end
if jit.arch == "x64" then
package.cpath = package.cpath .. ";/usr/lib/x86_64-linux-gnu/lua/5.1/?.so"