This is what we did to setup a few dashboards at platanus
- Raspberry Pi
- Dashing Service
- Wifi stick (optional)
defmodule Ticker do | |
require Logger | |
# public api | |
def start(recipient_pid, tick_interval, duration \\ :infinity) do | |
# Process.monitor(pid) # what to do if the process is dead before this? | |
# start a process whose only responsibility is to wait for the interval | |
ticker_pid = spawn(__MODULE__, :loop, [recipient_pid, tick_interval, 0]) | |
# and send a tick to the recipient pid and loop back | |
send(ticker_pid, :send_tick) | |
schedule_terminate(ticker_pid, duration) |
defmodule HttpRequester do | |
use GenServer | |
def start_link(_) do | |
GenServer.start_link(__MODULE__, nil, []) | |
end | |
def fetch(server, url) do | |
# Don't use cast: http://blog.elixirsips.com/2014/07/16/errata-dont-use-cast-in-a-poolboy-transaction/ | |
timeout_ms = 10_000 |
" settings | |
colorscheme molokai | |
let loaded_matchparen=1 " don't automatically highlight the matching parens | |
let mapleader = ' ' | |
let maplocalleader = ' ' | |
set autowriteall " autosave files | |
set background=dark | |
set clipboard=unnamedplus " Yanks go on clipboard | |
set cmdheight=2 |
<!doctype html> | |
<div id='output'>Output: </div> | |
<input type="text" id="op1" placeholder="Input 1" /> | |
<br> | |
<input type="text" id="op2" placeholder="Input 2" /> | |
<br> | |
<button onclick="calculate()">Add</button> |
<!doctype html> | |
<div id='output'>Output: </div> | |
<input type="text" id="op1" placeholder="Input 1" /> | |
<br> | |
<input type="text" id="op2" placeholder="Input 2" /> | |
<br> | |
<button onclick="calculate()">Add</button> |
This is what we did to setup a few dashboards at platanus
This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt
.
As it is not possible to change the ports used for the standalone
authenticator and I already have a nginx running on port 80/443, I opted to use the webroot
method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com
and example.com
).
For this, I placed config files into etc/letsencrypt/configs
, named after <domain>.conf
. The files are simple:
// run it using | |
// node loop_array_length.js | |
// => | |
// bad 7 ms | |
// good 5 ms | |
var a = [] | |
for (var i = 0; i < 10000000; i++) { | |
a.push(i); | |
} |
# Phoenix Framework - A productive web framework that does not compromise speed and maintainability | |
[Unit] | |
Description=Phoenix Framework ISControl Application | |
After=network.target | |
[Service] | |
Type=simple | |
User=deployer | |
RemainAfterExit=yes |
defmodule MyList do | |
# [ 1 , 2, 3, [ 1, 2]] | |
def flatten(list) do | |
do_flatten(list, []) | |
end | |
def do_flatten([h|t], acc_list) when is_list(h) do | |
# this may be expensive! | |
do_flatten(h ++ t, acc_list) | |
end |