Skip to content

Instantly share code, notes, and snippets.

View yorkxin's full-sized avatar
〽️

Yu-Cheng Chuang yorkxin

〽️
View GitHub Profile
@yorkxin
yorkxin / rfc6750.md
Created September 17, 2013 07:54
RFC 6750 in Markdown - Edited from http://tools.ietf.org/rfc/rfc6750.txt
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

Abstract

@yorkxin
yorkxin / README.md
Last active May 24, 2022 02:30
Config rbenv to use Homebrew-installed Ruby

A workaround for developers who cannot build Ruby from source code on their machine.

brew install ruby@<version>
ln -s $(brew --prefix ruby@<version>) ~/.rbenv/versions/<version>

For exmaple

@yorkxin
yorkxin / rfc6749.md
Last active April 6, 2022 11:54
RFC 6749 in Markdown - Edited from http://tools.ietf.org/rfc/rfc6749.txt
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

Abstract

@yorkxin
yorkxin / wordpressdotcom.rb
Created November 25, 2011 18:29
Wordpress.com (XML export) to Octopress importer. See http://git.io/x8yapw for change notes.
# coding: utf-8
# Original File: https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# Modified by Yu-Cheng Chuang <ducksteven@gmail.com>
# Licensed under MIT License (same as the original file)
# This version of wordpressdotcom.rb is compatible
# with the real-world Wordpress.com export file, which:
#
# - Makes paragraphs (<p>) and line breaks (<br>)
@yorkxin
yorkxin / avoid-jquery-when-possible.md
Created July 7, 2012 13:04
Avoid jQuery When Possible

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
yorkxin / A Note to My Fifty-Year-Old Self.md
Last active December 2, 2020 10:55
流氓阿德 Ardor Huang【給五十歲自己的備忘錄 A Note to My Fifty-Year-Old Self】
@yorkxin
yorkxin / README.md
Last active October 27, 2020 12:17
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.

Dependencies

  • Nokogiri
@yorkxin
yorkxin / README.md
Created September 16, 2013 06:43
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: 用來把 README.md 這種檔案給 render 成 HTML

@yorkxin
yorkxin / hdmi.md
Last active June 9, 2020 19:44
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

References:

@yorkxin
yorkxin / README.md
Created December 14, 2012 07:45
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)