Skip to content

Instantly share code, notes, and snippets.


Yu-Cheng Chuang yorkxin

View GitHub Profile
yorkxin /
Last active Apr 28, 2021
RFC 6749 in Markdown - Edited from
Internet Engineering Task Force (IETF)                     D. Hardt, Ed.
Request for Comments: 6749                                     Microsoft
Obsoletes: 5849                                             October 2012
Category: Standards Track
ISSN: 2070-1721

The OAuth 2.0 Authorization Framework


Internet Engineering Task Force (IETF)                          M. Jones
Request for Comments: 6750                                     Microsoft
Category: Standards Track                                       D. Hardt
ISSN: 2070-1721                                              Independent
                                                            October 2012

The OAuth 2.0 Authorization Framework: Bearer Token Usage


yorkxin / A Note to My Fifty-Year-Old
Last active Dec 2, 2020
流氓阿德 Ardor Huang【給五十歲自己的備忘錄 A Note to My Fifty-Year-Old Self】
View A Note to My Fifty-Year-Old
yorkxin /
Last active Oct 27, 2020
Amazon S3 Redirect Rules Generator

Amazon S3 Redirect Rules Generator

A Ruby script to generate simple Amazon S3 Redirection Rules XML file.

Update: There is an app for that now! Use Amazon S3 Redirector (Web app) and you can generate the XML without any knowledge about Ruby. Thanks to @rainforestapp. BTW, It's open source too.


  • Nokogiri
yorkxin /
Created Sep 16, 2013
HTML / Markdown filters by GitHub

html-pipeline: 把 text formatting 做成一層一層的 filter 接成 pipeline

linguist: 自動偵測一段文本或檔案的程式語言, GitHub 本身用它來偵測你專案使用的程式語言

charlock_holmes: 自動偵測文本的文字編碼,來自一個叫做 ICU 的資料庫,不知道是什麼,搜集了一堆文字編碼資訊和地區格式。

github-markdown: 實際在 GitHub 使用的 markdown compiler ,我找不到公開的 repo ,但程式碼是 MIT license ,很神秘…

github-markup: 用來把 這種檔案給 render 成 HTML


Avoid jQuery When Possible

jQuery does good jobs when you're dealing with browser compatibility. But we're living in an age that fewer and fewer people use old-school browsers such as IE <= 7. With the growing of DOM APIs in modern browsers (including IE 8), most functions that jQuery provides are built-in natively.

When targeting only modern browsers, it is better to avoid using jQuery's backward-compatible features. Instead, use the native DOM API, which will make your web page run much faster than you might think (native C / C++ implementaion v.s. JavaScript).

If you're making a web page for iOS (e.g. UIWebView), you should use native DOM APIs because mobile Safari is not that old-school web browser; it supports lots of native DOM APIs.

If you're making a Chrome Extension, you should always use native APIs, not only because Chrome has almost the latest DOM APIs available, but this can also avoid performance issue and unnecessary memory occupation (each jQuery-driven extension needs a separate

yorkxin /
Last active Jun 9, 2020
Raspberry Pi with HDMI Switch

For some HDMI switches (e.g. ATEN), to make HDMI hot plugging work well with Raspberry Pi, set the following in /boot/config.txt:

hdmi_force_hotplug=1 # always output HDMI even if not plugged in
hdmi_drive=2         # always output audio to HDMI
hdmi_group=1         # use CET mode (compatible with TV)
hdmi_mode=16         # use 1080p; otherwise it may switch to SD resolution


yorkxin /
Created Dec 14, 2012
Notes on Paul Irish's "Things I learned from the jQuery source" casts.

Notes on Paul Irish's "Things I learned from the jQuery source" casts

I watched these videos on 2012/12/14. Today's jQuery version is 1.8.3. So there might be some differences from the original video. I've briefly noted some of the differences between what described in the video and the current stable release. Most code he desribed can be found easily in speed/jquery-basic.js (1.4.2).

Episode 1

2010-06-14 (jQuery 1.4.1)

yorkxin /
Last active Aug 21, 2019
Proxy to remote server with CORS support
View for mitmproxy

Hacking CORS restriction to enable in-browser XHR to any server.


Say you are running an web app at localhost, and you want to send XHR to http://remote-server:80, but the CORS restriction forbids access because you are sending requests from an origin that remote-server:80 does not allow.


yorkxin / gist:221439
Created Oct 29, 2009
my DefaultFontFallbacks.plist
View gist:221439
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<!-- ATSUI-compatible preferred fallback -->
<!-- default ordered fallback list - fallback entity has to be PostScript name -->
<string>LucidaGrande</string> <!-- MAKE sure this matches the kCTFontSystemFontType in CTFontDescriptorCreateForUIType() & TDescriptorSourceImp::CreateDefaultDescriptor()! -->