Skip to content

Instantly share code, notes, and snippets.

View humorless's full-sized avatar

Laurence Chen humorless

View GitHub Profile
  • layout-component (ornament fn)
    • handle CSS part
    • leverage query syntax to assign CSS to child structure
  • widget-component (ornament fn)
    • small, reusable, and self-contained UI elements)
  • presenter-fn (ordinary fn)
    • handle pure html structure (withouth CSS)
    • example: fail-page
  • container-fn (ordinary fn)
    • handle the data && logic behavior
@humorless
humorless / metric.md
Created September 27, 2025 08:41
專業書籍的評分 metric

專業書籍的評分 metric

  1. Implied Reader 一致性
  2. 創新性
  3. 概念清晰度與結構化
  4. 實務可操作性
  5. 持久性(Timelessness)
## 假設您將書分成三個部分(Part 1, Part 2, Part 3),這是您給第一個部分(Part 1)的提示:
```
以下是一本專業書的第${n}部分。請你閱讀這段內容,並幫助我分析這段文字所預設的「隱含讀者」(implied reader)是什麼樣的人?
具體來說,請你從以下幾個方面來描述:
1. **讀者的背景知識:** 這位讀者可能具備哪些專業知識?是初學者、中級學習者還是該領域的專家?
2. **讀者的學習目標:** 這位讀者想從書中獲得什麼?是想解決特定問題、學習新技能還是獲取宏觀知識?
3. **讀者的思維模式與偏好:** 讀者可能習慣什麼樣的論證方式?是喜歡條列式說明、圖表輔助還是需要大量實例?
4. **基於以上分析,請你綜合描述這位「隱含讀者」的完整輪廓。**
@humorless
humorless / prompt.md
Last active August 12, 2025 02:23
prompts
  • Q1
如何在 neovim 裡註冊一個新的 filetype 
  • Q2
如果建立了一個新的 neovim plugin,比方說,叫做 conjure-piglet-client
該 plugin 用 fnl 寫多數的邏輯。

Directory

  1. ~/.config/nvim => 設定檔
  2. ~/.local/share/nvim => 資料檔

;; share:繼承了 UNIX 的歷史,用於存放使用者專屬的、與系統架構無關的應用程式資料。(無關,所以可以被不同的 CPU share)

Command

  1. :luado 執行一個 lua command
@humorless
humorless / vimscript.md
Last active April 2, 2025 19:41
VimScript 小整理

檢查狀態

  1. :verbose echo $variable 顯示變量的值和它的設定來源
  2. :checkhealth $Plugin 查看 Neovim 插件的狀態, 例如 :checkhealth nvim-treesitter
  3. :scriptnames 列出當前加載的所有腳本
  4. :map 列出當前所有的 mapping
  5. :nmap 列出 normal mode 的所有 mapping
  6. :autocmd 列出所有 auto command
  7. :set 列出所有的選項
  8. :echo g: 列出所有的全域變數
@humorless
humorless / assert-or-not.md
Created December 2, 2024 08:43 — forked from daveliepmann/assert-or-not.md
A guide to orthodox use of assertions in Clojure.

When to use assert?

In JVM Clojure, Exceptions are for operating errors ("something went wrong") and Assertions are for programmer and correctness errors ("this program is wrong").

An assert might be the right tool if throwing an Exception isn't enough. Use them when the assertion failing means

  • there's a bug in this program (not a caller)
  • what happens next is undefined
@humorless
humorless / sales_forecasting_monte.py
Last active November 2, 2024 10:47
The sales forecasting formula using Monte Carlo method
import numpy as np
import matplotlib.pyplot as plt
# 假設參數
lambda_visits = 5 # 主動拜訪次數的均值
lambda_leads = 3 # 主動找上門的客戶數均值
alpha = 0.1 # 主動拜訪轉換率
beta = 0.5 # 主動找上門轉換率
# 蒙地卡羅模擬
@humorless
humorless / prompt-business.md
Last active June 12, 2025 05:42
Good Prompt

推斷 niche market

從網路上現存的資訊,分析 {公司官方網站} 這家公司。

{公司名稱} 是什麼細分市場的領導者?

推斷 value proposition

@humorless
humorless / java-time.api.md
Created August 17, 2024 07:27
java time library

Duration

(time/duration dur-str)

ZoneId type

(def event-time-zone (java.time.ZoneId/of "Europe/Brussels"))