Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
from math import log
import funcy as fy
def f(x):
return x
@doggy8088
doggy8088 / settings.json
Last active February 20, 2024 06:28
Will 保哥的 VSCode 使用者設定檔
{
"explorer.openEditors.visible": 0,
"workbench.colorTheme": "Default Light+",
"workbench.iconTheme": "vscode-simpler-icons",
"workbench.sideBar.location": "right",
// 需下載安裝 Fira Code 字型 (安裝 OTF 格式)
// https://github.com/tonsky/FiraCode/releases
// 需下載客製化過的 Microsoft YaHei Mono 字型
@chairco
chairco / asgi-zh_TW.rst
Last active December 7, 2020 08:45
ASGI 規範中文版

ASGI (Asynchronous Server Gateway Interface) Specification

Version: 2.0 (2017-11-28)

Abstract 摘要

This document proposes a standard interface between network protocol

@weihanglo
weihanglo / tokio-internals.md
Last active July 12, 2024 21:35
【譯】Tokio 內部機制:從頭理解 Rust 非同步 I/O 框架

本文譯自 [Tokio internals: Understanding Rust's asynchronous I/O framework from the bottom up][tokio-internals]。
Thanks [David Simmons][david-simmons] for this awesome article!

[Tokio][tokio] 是 Rust 的開發框架,用於開發非同步 I/O 程式(asynchronous I/O,一種事件驅動的作法,可實現比傳統同步 I/O 更好的延伸性、效能與資源利用)。可惜的是,Tokio 過於精密的抽象設計,招致難以學習的惡名。即使我讀完教程後,依然不認為自己充分內化這些抽象層,以便推斷實際發生的事情。

從前的非同步 I/O 相關開發經驗甚至阻礙我學習 Tokio。我習慣使用作業系統提供的 selection 工具(例如 Linux epoll)當作起點,再轉移至 dispatch、state machine 等等。倘若直接從 Tokio 抽象層出發,卻沒有清楚了解 epoll_wait() 在何處及如何發生,我會覺得難以連結每個概念。Tokio 與 future-driven 的方法就好像一個黑盒子。

let disposeBag = DisposeBag()
// 模擬 indicator 顯示/隱藏狀態
let indicator = Variable(false)
// 按鈕
lazy var loginButton: UIButton = {
let button = UIButton(type: .system)
button.tintColor = UIColor.red
button.setTitle("登入", for: .normal)
@doggy8088
doggy8088 / Angular 18 Dev Setup.md
Last active July 9, 2024 07:17
Angular 18 開發環境說明

Angular 18 開發環境說明

為了能讓大家能夠順利的建立起 Angular 18 開發環境,以下是需要安裝的相關軟體與安裝步驟與說明。

Angular LOGO

[ 作業系統 ]

  • Windows 10 以上版本
  • Mac OS X 10.6 以上版本
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
X = np.linspace(0, 10, 256)
plt.plot(X)
@revolunet
revolunet / web-audio-fetch-stream.js
Last active June 30, 2024 09:21
Web Audio streaming with fetch API
//
// loads remote file using fetch() streams and "pipe" it to webaudio API
// remote file must have CORS enabled if on another domain
//
// mostly from http://stackoverflow.com/questions/20475982/choppy-inaudible-playback-with-chunked-audio-through-web-audio-api
//
function play(url) {
var context = new (window.AudioContext || window.webkitAudioContext)();
@billy3321
billy3321 / Markdown Cheatsheet 中文版.md
Last active July 8, 2024 08:40
Markdown Cheatsheet 中文版
@btroncone
btroncone / rxjs_operators_by_example.md
Last active June 15, 2024 07:17
RxJS 5 Operators By Example