Skip to content

Instantly share code, notes, and snippets.

View FlandreDaisuki's full-sized avatar
🌈
世界にバグは不要です

Chun-Hao Lien FlandreDaisuki

🌈
世界にバグは不要です
View GitHub Profile

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 給了演講《函數程式設計的商業應用》

@FlandreDaisuki
FlandreDaisuki / Dockerfile
Created January 14, 2024 15:52 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/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
@FlandreDaisuki
FlandreDaisuki / _node-basic-websocket-server.md
Created November 29, 2023 10:25 — forked from kevinchisholm/_node-basic-websocket-server.md
Code Examples for my Blog Post: Create a Node.js Websocket Server in Five Minutes
@FlandreDaisuki
FlandreDaisuki / Infrastructure.js
Created February 19, 2022 01:42 — forked from sebmarkbage/Infrastructure.js
SynchronousAsync.js
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);
}
@FlandreDaisuki
FlandreDaisuki / foo.ts
Created March 30, 2021 02:07 — forked from OliverJAsh/foo.ts
Records and dictionaries in TypeScript
/*
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(() => {
@FlandreDaisuki
FlandreDaisuki / m3u8-to-mp4.md
Created January 26, 2018 17:01 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@FlandreDaisuki
FlandreDaisuki / cs.py
Created January 18, 2018 10:16 — forked from myano/cs.py
Quick example of ncurses in Python!
#!/usr/bin/env python
import curses
import curses.textpad
import time
stdscr = curses.initscr()
#curses.noecho()
#curses.echo()
@FlandreDaisuki
FlandreDaisuki / dom_load_order.user.js
Created October 22, 2017 10:48 — forked from ipcjs/dom_load_order.user.js
Dom相关事件的执行顺序
// ==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==
@FlandreDaisuki
FlandreDaisuki / GM_download_polyfill.js
Created February 18, 2017 02:32 — forked from ccloli/GM_download_polyfill.js
GM_download polyfill, a polyfill to make your userscript supports GM_download
/*
* GM_download polyfill
*
* @description A polyfill to make your userscript supports GM_download
* @author ccloli
* @version 1.0
*/
// to use this polyfill, you must add "@grant GM_xmlhttpRequest" at userscript metadata block