Adding the newest Loading Animation feature to LINE Bot
Background I was integrating internal machine learning features to our official account bot, specifically STT and OCR services. The long pending time may cause confusion and uncertainty to the user. Adding a loading animation can help to improve the user experience. API Guide We can add a loading animation via sending a request. Here is an example from API doc using curl: 1 2 3 4 5 6 7 curl...
Setup My Mac
System Settings Keyboard Key repeat rate and delay until repeat Modify shortcuts for screenshots Under Desktop & Doc > Shortcuts set ShowDesktop to right option key Enable Hot Corners under Desktop & Doc > Hot Corners Menu Bar and Control Center Cleanup Dock and move to right Configs 1 2 cd ~/Desktop/code git clone https://github.com/patty111/configs.git Homebrew Install homebrew Install packages 1 2 cd ~/Desktop/code/configs/macOS brew bundle raycast disable window navigation disable spotlight iterm install nerd font CascadiaMono or CascadiaCove and import rectangle github ssh key setup git config Install cargo Solana cli Zsh Install oh-my-zsh config file and plugins setup 1 cp ~/Desktop/code/configs/macOS/....
Github SSH Setup
Setup Authentication with Github using SSH, github username/password authentication is deprecated. Generate SSH Key 1 ssh-keygen -t rsa -b 4096 -C "your_email@example.com" This should generate a public and private key pair in ~/.ssh/ directory. Should be something like id_rsa and id_rsa.pub. Github Setup Go to github > settings > SSH and GPG keys > New SSH key and paste the contents of id_rsa.pub file. Key type used is authentication key....
Risk in token 2022 CPI: CPI Guard and Arbitrary CPI
Original Post for Solana Writeathon CPI 全名叫做 Cross Program Invocation,它可以讓Solana的program直接呼叫另一個Program中的instruction,這...
SPL Token & Token Ext
Original Post for Solana Writeathon Account Model SPL 是 Solana Program Library 的簡稱,是一個用來在 Solana 上創造 fungible/non-fungible token 的工具,內含多個Program Account。 有別於以往在 Ethereum 上,每當想創造新的 token 就需...
Solana Pay 101
Original Post for Solana Writeathon Solana是什麼碗糕? Solana 是一個由Solana Labs於2020推出的區塊鏈網路, 採用PoS與PoH機制,與ETH、BTC相比有著...
How to Read MPEG Header? A Simple Attempt to Impl a MPEG Parser
I was trying to get the sample rate of some audio data. Due to licensing issue and some other restrictions, I can’t use some existing libraries to parse the MPEG header. So I decided to write a simple parser to get the sample rate from the MPEG header. The audio data I will be mainly working about is MP3 and M4A. MPEG Format MPEG is a standard for coding audio-visual information....
Event Loop, Promises, Task Queues and Callstack
Recently reading Event Loop, Promises, Task Queues, Call Stack, and Web APIs in Js. Just jotting down some notes. JavaScript Js is single-threaded, when handling long-running tasks it could block the main thread, causing the UI to freeze. To avoid this, Js uses the following mechanisms to handle async tasks. Call Stack When a function is called, it is pushed onto the call stack. When the function returns, it is popped out of the stack....
ASGI? WSGI?
This is what a FastAPI app using Gunicorn managing Uvicorn workers may look like in a nutshell: Web Server vs Application Server vs Web Client Web servers are especially good at serving static content, they are also good at caching, load balancing, and doing reverse proxy. Apache and Nginx are common web servers. Application servers are designed to run application code, they are good at handling dynamic content, and they can run multiple languages....
Cherry Pick使用隨筆
前情提要 前幾天在工作的時候開發了一個feature1並且送了 Pull Request, 但是到今天為止都還沒有被 Review, 這時候我需要繼續開發下一個feature2。這個f...