GitHub 加上 +1 與 -1 功能 (順便加上表情符號)

這是回應之前社群對 GitHub 的請願 (or 抱怨?) 而生的新功能,(參考先前的文章「GitHub 對 Open Source Community 請願的回應」):「Add Reactions to Pull Requests, Issues, and Comments」。

這避免了在討論時大量的 +1 與導致混亂的情況。

GitHub 對 Open Source Community 請願的回應

大約一個多月前 (2016 年一月 15 日),一群用 GitHub 發展 Open Source 軟體的人對 GitHub 提出請願,要求重視 Open Source Community 在 GitHub 平台上遇到的問題:「An open letter to GitHub from the maintainers of open source projects」。

這個請願在卡了將近一個月後,陸陸續續有相當多要搬出 GitHub 的討論,像是 eslint 就直接在 GitHub 開了 issue,討論搬出 GitHub 會遇到的問題以及可能的解決方法:「Investigate switching away from GitHub」。

在二月 13 日的時候,GitHub 透過 pull request 發出回應說「我們在處理了」,但也沒講正在處理什麼,看起來就是個很 PR 的回應:「Dear Open Source Maintainers」。

直到昨天,三個主要的請願中關於 issue 範本的問題 (也就是下面這段) 總算有進展了:

Issues are often filed missing crucial information like reproduction steps or version tested. We’d like issues to gain custom fields, along with a mechanism (such as a mandatory issue template, perhaps powered by a newissue.md in root as a likely-simple solution) for ensuring they are filled out in every issue.

為了解決使用者在開 issue 時有時會忘記給出完整的環境資訊 (以及其他有用的資料),GitHub 推出了新的功能,在開 issue 或 pull request 時利用 template 讓使用者有個範本可以照著填寫,同時 template 也支援 Markdown,讓填寫的方式會更豐富一些:「Issue and Pull Request templates」。

這總算開始有進展了。但也開始感覺到 GitHub 的動作已經開始慢下來了...

GitHub 上 Pull Request 的男女歧視問題

衛報報導了從 GitHub 上分析 pull request 的性別分析研究:「Women considered better coders – but only if they hide their gender」,原始論文出自「Gender bias in open source: Pull request acceptance of women versus men」。

研究的結果說明女性的 pull request 接受機率比男性高,但如果貢獻者可被確認是女性的話則會反過來,也就是說男女歧視問題是可被觀察到的:

Surprisingly, our results show that women's contributions tend to be accepted more often than men's. However, when a woman's gender is identifiable, they are rejected more often. Our results suggest that although women on GitHub may be more competent overall, bias against them exists nonetheless.

由於性別資訊不是必填項目,論文裡面也有提到透過 social network 的資料比對,以及其他方式去推測。這個研究成果看起來應該會產生不少討論...

把 HTTP 站台逐步換向 HTTPS 站台的步驟

Jerry Qu 寫的「关于启用 HTTPS 的一些经验分享」這篇文章講了要怎麼將 HTTP 站台逐步換成 HTTPS 站台的方式 (以及工具)。

一開始會遇到 Mixed Content,瀏覽器預設值不會直接全部擋掉,而是會放行圖片類資源 (但是出現對應的警告)。然後可以用 upgrade-insecure-requests 來幫助邊換,讓 url 裡指定 http 的自動連到 https。

當全站把 url 都修完後,接著就可以考慮用 HSTS 強制全上 HTTPS。

做到這邊的安全性已經到一定程度了,接下來要不要進 HSTS Preload List 就看大家自己的想法了。

把 GitHub 上的 pull request 對應到 Git branch...

昨天看 Hacker News 的文摘看到的:「Checkout github pull requests locally」。

方法是對 remote "origin" 加上 fetch = +refs/pull/*/head:refs/remotes/origin/pr/*,這樣就會把 pull request 拉下來...

下面的 comment 也有不少討論可以看...

惡搞的 pull request 被人嫌到不行...

GitHub 上總是有人會送一些奇怪的 pull request 出來,把整個 code repository 砍掉換成惡搞的東西... 這次是 CoderDojo / CoderDojo-Kata 這個專案被人發 pull request 要惡搞,結果一堆人利用 comment 的功能開始嫌東嫌西:「pull 1」。

看完一次後覺得實在是太... 有趣 XDDD 乾脆列出來:

  • 沒有 doctype。
  • <style> 沒有指定 type。
  • <script> 指定的版本居然是 JavaScript 1.2... XDDD
  • 「你的 code 疑似抄自 1995 年的 sample,請考慮加回 GPL statement」
  • jslint 掛得很慘 XDDD
  • javascript 裡使用不必要的全域變數。
  • 可以用三元表示式讓 code 更清楚。
  • 變數名稱不具意義 XD
  • setInterval() 只是要呼叫一個 function,可以直接用 function name 而不需要用字串。
  • 為什麼你不縮排呢,很難讀耶...
  • 為什麼結尾不加上分號呢 (然後就呼叫 Douglas Crockford XDDD)
  • body 加上 bgcolor 被罵 XDDD
  • bgcolor 的顏色用 #000000 也被罵 XDDD 應該用 #111111... XDDD
  • 用 <br/> 排版被罵應該用 css 排 XD
  • table 排版再被罵...
  • single-quote 與 double-quote 混用也被罵不一致...
  • 用 inline css 被糾正 XD
  • 裡面用到圖片被稱讚 XDDD 被問圖片裡的鍵盤哪裡可以買 XDDD
  • 然後圖片沒有 alt 也被刁 XD
  • 沒用 safe color 被揍...
  • 下面有 alt 的圖片,但 alt 內容是空白而被人罵,但就有人很認真的回他說「alt 空白是合法而且某些 case 下是正確的語意,blah blah blah...」XDDD
  • 用 <b> 被提醒 deprecated,然後又有人很認真的回「在 HTML5 裡面被 undeprecated 了」XDDD
  • 出現 "click here" 但卻不能按啊啊啊

(倒地不起)

429 Too Many Requests

剛剛在「Apache HTTP ServerをRFC6585の"429 Too Many Requests"に(とりあえず)対応させるパッチ」看到的... 429 Too Many Requests 是在四月才被提出來的 (RFC 6585),雖然還不是 Standard (目前是 Proposed Standard),但看起來不錯啊...

一定要放一張經典畫面...