為什麼 caniuse 裡沒有 iOS Chrome 跟 iOS Firefox

狐の足あと@尾道
狐の足あと@尾道

caniuse 是一個整理了各瀏覽器各版本對不同 feature 支援度的網站,舉凡在 CSS, HTML5, JavaScript 的支援度都有詳細的整理與比較。但某天我想要查各家 Mobile Browser 對 WebAuthn 的支援度時,發現表格裡找不到 Chrome for iOSFirefox for iOS

error: no such function: json_extract

在尾道貓之細道遇到在板凳睡覺的貓
在 尾道-貓之細道 遇到在板凳睡覺的貓

在某專案遇到了 Database Query 時,要根據某欄位所儲存 JSON 的特定值做排序的狀況。 使用的資料庫是 SQLite,所以該欄位實際上是 TEXT 類型,需要先用 json_extract 函式來取 JSON 的特定值。 JSON 格式跟 SQL 語法類似:

{
  "birthday": {
    "year": 1989,
    "month": 11,
    "day": 21
  }
}
SELECT * FROM user ORDER BY json_extract(user.profile, '$.birthday.year') DESC
-- profile 實際上是 TEXT 類型的欄位

DB4S 執行 SQL 測試起來沒問題之後就開始進行對應 API 的開發。專案是以 Golang 開發,ORM 使用 xorm (底層 Driver 為 go-sqlite3)。

讓文章圖片有 figcaption

Cat
這是一張貓咪的圖片

使用 GatsbyJS 框架時,搭配 plugins 來快速架設網站或部落格非常方便。像是搭配 gatsby-transformer-remarkgatsby-remark-images 這兩個 plugins,就可以從 Markdown 檔案產生出圖文並茂的部落格文章。

在 gatsby-remark-images 的 config 中有一個欄位 showCaptions 預設是 false。如果改成 true 的話,Markdown 的每張圖片會產生對應的 figcaption,內容是圖片的 title 或是 alt

想嘗試的 Framework
  • Front-end

One of the biggest gains from MVC

The responsibilities of each layer

  • Controller - bridge between the model and view. Decides where to go next.
  • View - displays the data, gathers user input
  • Model - business logic, interface to data store.
© 2019 Hau Chen