Skip to content

Instantly share code, notes, and snippets.

Avatar
〽️

Yu-Cheng Chuang yorkxin

〽️
View GitHub Profile
@yorkxin
yorkxin / KeyBindings.json
Last active Nov 29, 2018
My Sublime Text 2 Config
View KeyBindings.json
/* Default (OS X).sublime-keymap */
/* Key Bindings - User */
[
{ "keys": ["ctrl+shift+."], "command": "erb", "context":
[
{
"key": "selector",
"operator": "equal",
"operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee"
}
@yorkxin
yorkxin / .zshrc
Last active Jun 4, 2018
My ZSH Settings
View .zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="yaci"
ZSH_THEME="yaci-agnoster"
@yorkxin
yorkxin / javascript_resources.md
Last active Aug 18, 2017 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.
View javascript_resources.md

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@yorkxin
yorkxin / rails_resources.md
Last active Aug 18, 2017 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.
View rails_resources.md

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@yorkxin
yorkxin / Radio.md
Created Feb 14, 2016
廣播電台
View Radio.md
View Podcasts.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>iTunes Subscribed Feeds</title>
<dateCreated>Fri, 03 Mar 2017 08:41:34 GMT</dateCreated>
<dateModified>Fri, 03 Mar 2017 08:41:34 GMT</dateModified>
</head>
<body>
<outline text="硬影像" type="rss" xmlUrl="http://ipn.li/hardimage/feed" htmlUrl="https://ipn.li/hardimage/" />
<outline text="一天世界" type="rss" xmlUrl="http://ipn.li/yitianshijie/feed" htmlUrl="https://ipn.li/yitianshijie/" />
@yorkxin
yorkxin / README.md
Last active Aug 10, 2016
Safari 6 Default Font Fallback Fix (for CJK users)
View README.md

Safari 6 的預設字體也崩潰了

跟 Chrome 一樣, Safari 6 也使用 html tag 的 lang attribute 來判斷要用哪一套字體來 fallback (參考這裡)。以繁體中文的 zh-TW 為例,它會 fallback 到 Heiti TC (黑體-繁),不只漢字,連英文、數字都套用。我不喜歡這樣,理由:

  1. Heiti TC / Heiti SC 的英文與數字很醜。
  • Heiti TC / Heiti SC 的日文假名也很醜,注音符號更醜,後者尤其是讓我身為台灣人卻沒感到尊重。
  • zh 視為 zh-cn ,所以如果到了 維基百科 ,你就會看到簡體版的 Heiti SC (黑体-简),也就是中國國家標準的漢字及標點符號;不是看到簡體字,而是某些字筆畫有些不同,以及標點符號從正中間挪到左下方(參考漢字標準格式・標點樣式)。
  • 出於個人偏好,我對整個 OS X 設定了繁體中文(Hant)、簡體中文(Hans)都使用 Hiragino Sans GB (冬青黑體)而非預設的 Heiti TC / Heiti SC,雖然標點符號不符合台灣的規範,而且一樣有漢字寫法的問題,但字比較美。 Safari 的行為把這一原則給推翻了,我又看到了 Heiti TC / Heiti SC (怒)。

這裡提供一個解決方法

@yorkxin
yorkxin / README.md
Last active Mar 1, 2016
CJSX (CoffeeScript + JSX) to ES6
View README.md

(Not) CJSX to ES6 converter

It does noly convert a small set of codes into ES6. You sill need to edit the file.

Usage

find ./components -name "*.cjsx" -exec ./converter.sh {} \;
@yorkxin
yorkxin / .vimrc
Last active Dec 22, 2015
my .vimrc
View .vimrc
set cindent
set hls " highlight search rersult
set nocompatible
set sw=2
set ts=8
set cursorline
syntax on
if has('gui_running')
@yorkxin
yorkxin / wordpressdotcom.rb
Created Nov 25, 2011
Wordpress.com (XML export) to Octopress importer. See http://git.io/x8yapw for change notes.
View wordpressdotcom.rb
# 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>)