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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Code Examples for my Blog Post: Create a Node.js Websocket Server in Five Minutes
The full Github repo can be found here: https://github.com/kevinchisholm/video-code-examples/tree/master/node/websocket-basic-server
- Clone this repo:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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 給了演講《函數程式設計的商業應用》。
OlderNewer