About Cognitive Load

非常好的文章 https://github.com/zakirullin/cognitive-load?ref=blog.waynechu.cc

Wayne

LLM RAG 簡單實作範例以及限制

這篇文章作者用 Python 實作了一個簡單的 Harry Potter Q&A https://medium.com/@petrpan/llm-101-build-your-own-book-reading-bot-or-search-engine-with-llm...

Wayne

如何播放音樂?

音樂被儲存以後 (可見 "[無損音樂是什麼?](https://blog.waynechu.cc/whats-nondestructive-music)" ),要怎麼被播放出來呢? 1. 首先要有一個設備讀取音樂的訊號,例如 0/1 的訊號 2. 需要把這個訊號...

Wayne

無損音樂是什麼?

首先,除非你現場聽不插電演奏,否則沒有任何的音樂是無損的。為什麼呢? 因為音樂紀錄的方式是把音波轉換為 0 and 1 的形式儲存,期間一定會有耗損,所謂的無損音樂就是指耗損少到一般人聽不出來而已。 那麼音樂如何儲存呢? (注意這裡講的是儲存,也就是音源,...

Wayne

Open AI 的 prompt guide

[https://platform.openai.com/docs/guides/prompt-engineering/strategy-provide-reference-text?](https://platform.openai.com/docs/guides/pro...

Wayne

Migrate blog to Ghost

### Reason 原本我的 blog 是用 Rails 寫的簡單 blogger,原因沒別的就是當時閒閒無聊想說自己的 blog 自己做,什麼都可以客製化,的確是用起來很順手,用了各種工具做了看得順眼的 syntax highlights、好用的 editor、自...

Wayne

Customize Mac sleep shortcut without any 3rd party software

Settings -> Keyboard -> Keyboard Shortcuts -> App Shortcuts -> Add new shortcut to All application, name is `Sleep` ![Screenshot 2023-1...

Wayne

GPT prompt concepts

#### 1. Chain of Thought Chain of Thought (CoT) is a prompting technique used to encourage the model to generate a series of intermedia...

Wayne

Stripe API 的發展史 - Stripe’s payments APIs: The first 10 years

看起來是蠻有趣的故事,先收起來有機會再詳讀 https://stripe.com/blog/payment-api-design

Wayne

About passwordless authentication

## TL;DR: 1. Single Sign-On (SSO) 2. Biometrics 3. Possession factors -> OTP 4. Magic links 再來簡單了解一下各分類: 1. SSO -> FB login, Google Lo...

Wayne

Rails 7 with bootstrap 5

照這個教學 https://jasonfleetwoodboldt.com/courses/stepping-up-rails/rails-7-bootstrap/

Wayne

How to use Active Record Encryption without Rails credential

This post will teach you how to use Active Record Encryption with Dotenv ### Step 1: generate credential First of all, follow [officia...

Wayne

Named parameters with flow.js

```js const constructOAuthAPIUrl = ( { path, redirectUri, state, scopes, }: { path: string, redirectUri: str...

Wayne

React hook use useEffect as useState callback

`useState` doesn't have callback function and it's asynchronous, so if we need to monitor when the state got changed, we need to combine ...

Wayne

Mac 外接滑鼠移動速度

下這個指令關閉智障的滑鼠移動加速,若沒關閉的話每次滑鼠移到按鈕旁邊就會變慢,有夠智障 ```sh defaults write .GlobalPreferences com.apple.mouse.scaling -1 ``` 聽說調過滑鼠移動速度後這個設定就會重新倍 ...

Wayne

DHH shares hey.com Gemfile

```rb ruby '2.7.1' gem 'rails', github: 'rails/rails' gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data # Actio...

Wayne

How to write a good test description

My logic is very similar to this article https://guilhermesimoes.github.io/blog/writing-good-test-descriptions 其實很簡單,就是 test description...

Wayne

Feature toggle - configuration over code

很久之前的 Post [Feature toggle (a.k.a Feature Flags) in Ruby and gems to use](https://waynechu.cc/posts/441-feature-toggle-a-k-a-feature-fla...

Wayne

Golang environment variable

1. Built-in `os` package 2. Ruby style `godotenv` https://github.com/joho/godotenv 3. Recommended `viper` https://github.com/spf13/viper ...

Wayne

Golang version manager

GVM: https://github.com/moovweb/gvm Built-in: https://icanhazdowntime.org/posts/2019-10-11-go-has-a-built-in-go-version-manager/ ## Re...

Wayne

How to revert git --amend commad?

1. use `git reflog` to see when did the ammend action happend, let's say it happened at HEAD@{4} 2. use `git reset --soft HEAD@{4}` 3. r...

Wayne

Latency Numbers Every Programmer Should Know

Copied from https://gist.github.com/jboner/2841832 Latency Comparison Numbers (~2012) ---------------------------------- L1 cache refere...

Wayne

壓力測試的工具 - JMeter

JMeter 是個可以拿來做 performance testing 的工具,可以併發 request 做壓力測試 https://jmeter.apache.org/ ![Screenshot 2020-06-29 18.13.02.png](https://wayn...

Wayne

Library v.s. Framework

終於看到一個簡單明瞭的分類方試 會 call 你的 method 的叫 framework, 只有你會 call 他的 method 的叫 library >- Framework: If you have code in a jar that you import a...

Wayne

How OTR (Off-the-Record) Messaging works

OTR stands for Off-the-Record Messaging, the OTR protocol was designed by cryptographers Ian Goldberg and Nikita Borisov and released on ...

Wayne