Skip to content

Instantly share code, notes, and snippets.

@AntonRich
AntonRich / http_server.ex
Last active September 10, 2021 16:36
Very basic HTTP server in Elixir. Trying to learn the concept of Supervision.
defmodule HttpServer do
require Logger # because Logger built in part with macros
@port 8000
@http_options [active: false, packet: :http_bin, reuseaddr: true]
def start_link() do
spawn_link(HttpServer, :init, [])
end
def init() do
@AntonRich
AntonRich / js
Created June 13, 2021 19:11
hyperscript-browser
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
@AntonRich
AntonRich / the-alegbra-of-typescript.md
Created June 7, 2021 14:07 — forked from tkersey/the-alegbra-of-typescript.md
The Algebra of [Type,Script]

Algebra

Symbols Operations Laws
0, 1, 2, x, y, z, ... +, –, x, ÷, ... 0 + x = x, ...

Algebra

Symbols Operations Laws
@AntonRich
AntonRich / gist:7d6c58104f22060942883f26891bec3f
Created May 8, 2019 13:24
Timetable for a french audiobook "le petit prince"
00:05 - 00:54 Dédicace, À léon werth
00:54 - 01:37 Premier chapitre. Lorsque j'avais six ans
01:36 - 02:06 J'ai montré mon chef-d'œuvre
02:06 - 02:35 Les grandes personnes m'ont conseillé de laisser
02:35 - 03:08 J'ai donc dû choisir un autre
inxi -Fx
System:
Host: anton-pc Kernel: 4.19.32-1-MANJARO x86_64 bits: 64 compiler: gcc
v: 8.2.1 Desktop: Xfce 4.13.3git-UNKNOWN Distro: Manjaro Linux
Machine:
Type: Laptop System: ASUSTeK product: X555LJ v: 1.0
serial: <root required>
Mobo: ASUSTeK model: X555LJ v: 1.0 serial: <root required>
UEFI: American Megatrends v: X555LJ.305 date: 05/26/2015
Battery:
@AntonRich
AntonRich / gist:11b59042adc1d76498aaf2318f54567c
Created April 7, 2019 06:15
Anki Bug Log, starting the app from the terminal
qt: using qt5ct plugin
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
qt: Unrecognized OpenGL version
qt: Unrecognized OpenGL version
mpv not found, reverting to mplayer
qt: D-Bus global menu: no
[10258:10275:0407/091438.224859:ERROR:gl_context_glx.cc(232)] Couldn't make context current with X drawable.
[10258:10275:0407/091438.224884:ERROR:gpu_info_collector.cc(68)] gl::GLContext::MakeCurrent() failed
[10258:10275:0407/091438.224899:ERROR:gpu_info_collector.cc(186)] Could not create context for info collection.
@AntonRich
AntonRich / gist:847033e2de357c17149037fe57b56af5
Created February 5, 2019 01:19
The list of players doesn't fetch.
-- MODEL
type alias Model =
{ gamesList : List Game
, playersList : List Player
}
type alias Player =