Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v
on the command line.
$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
import time | |
import board | |
import busio | |
import adafruit_mlx90640 | |
import displayio | |
number_of_colors = 13 | |
palette = displayio.Palette(number_of_colors) # Palette with all our colors |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
defmodule GCM.Pusher do | |
use GenStage | |
# The maximum number of requests Firebase allows at once per XMPP connection | |
@max_demand 100 | |
defstruct [ | |
:producer, | |
:producer_from, | |
:fcm_conn_pid, | |
:pending_requests, |
defmodule GCM.PushCollector do | |
use GenStage | |
# Client | |
def push(pid, push_requests) do | |
GenServer.cast(pid, {:push, push_requests}) | |
end | |
# Server |
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get --assume-yes install wget | |
sudo apt-get --assume-yes install libssl-dev | |
sudo apt-get --assume-yes install ncurses-dev | |
sudo apt-get --assume-yes install m4 | |
# erlang | |
wget http://erlang.org/download/otp_src_18.2.tar.gz | |
tar -xvzf otp_src_18.2.tar.gz | |
cd otp_src_18.2 |
defmodule TestDefp do | |
defmacro __using__(_) do | |
quote do | |
import Kernel, except: [defp: 2] | |
end | |
end | |
# Let's redefine `defp/2` so that if MIX_ENV is `test`, the function will be | |
# defined with `def/2` instead of `defp/2`. | |
defmacro defp(fun, body) do |
;; response to: https://forums.pragprog.com/forums/352/topics/13835 | |
;; this is a quick demonstration of the pitfalls in querying for a ref | |
;; outside of the accompanying transaction in which you plan on changing it. | |
(import '(java.util.concurrent Executors)) | |
;; start list | |
(def slist (ref #{})) |
@ECHO OFF | |
SETLOCAL | |
GOTO:MAIN | |
REM | |
REM Info functions start | |
REM | |
REM Display version and copyright information | |
:VERSION |
$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769
Note the running on port
for epmd
itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:
$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host