xhost +local:docker
docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix ...
Every now and then I want to run X apps inside docker, and then I always hit some issues.
FP 在應用程式的高峰可能在 2013~2014 左右,那時 John Carmack port Wolf3D 到 Haskell 上,還提到:
I haven't done any functional programming since I started crunching at Oculus, but I consider the time I spent on it extremely worthwhile.
也說過:
I feel a touch of impostor syndrome when I get invited to speak at functional programming conferences.
同年 (2014) audreyt 在 FLOLAC'14 給了演講《函數程式設計的商業應用》。
| #!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')" | |
| # syntax = docker/dockerfile:1.4.0 | |
| FROM node:20 | |
| WORKDIR /root | |
| RUN npm install sqlite3 |
| let cache = new Map(); | |
| let pending = new Map(); | |
| function fetchTextSync(url) { | |
| if (cache.has(url)) { | |
| return cache.get(url); | |
| } | |
| if (pending.has(url)) { | |
| throw pending.get(url); | |
| } |
| /* | |
| In JavaScript, objects can be used to serve various purposes. | |
| To maximise our usage of the type system, we should assign different types to our objects depending | |
| on the desired purpose. | |
| In this blog post I will clarify two common purposes for objects known as records and dictionaries | |
| (aka maps), and how they can both be used with regards to the type system. |
| import AbortController from "abort-controller" | |
| import { AbortSignal } from "abort-controller" | |
| import { AbortablePromise } from "." | |
| var controller = new AbortController() | |
| function sleep (signal: AbortSignal, time: number) { | |
| return AbortablePromise(signal, function (resolve, reject, handleCancel) { | |
| var id = setTimeout(resolve, time) | |
| handleCancel(() => { |
| #!/usr/bin/env python | |
| import curses | |
| import curses.textpad | |
| import time | |
| stdscr = curses.initscr() | |
| #curses.noecho() | |
| #curses.echo() |
| // ==UserScript== | |
| // @name New Userscript | |
| // @namespace https://github.com/ipcjs | |
| // @version 0.0.1 | |
| // @description try to take over the world! | |
| // @author ipcjs | |
| // @match http://bangumi.bilibili.com/anime/5788/play* | |
| // @grant none | |
| // @run-at document-start | |
| // ==/UserScript== |