Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Andor Chen AndorChen

I may be slow to respond.
View GitHub Profile
AndorChen /
Last active Jun 16, 2021



  • 正文:书宋+times英文复合字体 (字号:9.5号)

  • 章节:中圆+helvetica英文复合字体 (字号:19号)

  • 章节标题:大黑+helvetica英文复合字体(字号:30号,字体宽度缩为80%)

View test.rb
def hello
puts 'hello'
View pandocfilter.rb
require 'json'
class String
def camelize
string = self
module PandocFilter
View Rakefile
require 'fileutils'
# Usage: rake duokanify file=path/to/sample.epub
desc 'Adds dtb:depth to ncx file in an ePub'
task :duokanify do
unless ENV['file']
abort("ERROR: Please provide the ePub file path!\nexit")
unless ENV['file'].end_with?('.epub')
View fonts.css
Prince - Fonts stylesheet
/* standard "serif" font family */
@font-face {
font-family: serif;
src: local("Arial Unicode MS") /* last resort font */
AndorChen / functions.php
Created Jan 17, 2012
Add Links to WordPress 3.3 New Toolbar
View functions.php
* Add Links to WP3.3+ New Toolbar
add_action('admin_bar_menu', 'add_toolbar_items', 100);
function add_toolbar_items($admin_bar) {
// Top level menu
$admin_bar->add_menu( array(
'id' => 'my-item',
View functions.php
add_action('after_setup_theme', 'ac_theme_setup');
function ac_theme_setup(){
// 自定义导航菜单
register_nav_menu('top', '顶部菜单');
AndorChen / README.textile
Created Dec 16, 2011
What fonts and charset do you use?
View README.textile


站点 html lang 编码 字体定义
Google utf-8 font-family: arial,sans-serif; font-size: small;
百度 gb2312 font: 12px arial;
必应 en utf-8 font-family: Arial,Sans-Serif; font-size: small;
MSN中文网 utf-8 font-family: Tahoma, 宋体, sans-serif;
搜狐 zh-CN GBK font: 12px '宋体';
搜狐微博 GBK font: normal 12px/1.667 Tahoma,Arial,"宋体b8b\4f53",sans-serif;
新浪 gb2312 font: 12px "SimSun","宋体","Arial Narrow";
AndorChen / jquery.html5.placeholder.js
Created Dec 9, 2011
jQuery HTML5 Placeholder fix
View jquery.html5.placeholder.js
* jQuery.HTML5 placeholder - Placeholder plugin for input fields
* Written by Ludo Helder (ludo DOT helder AT gmail DOT com)
* Licensed under the WTFPL (
* Date: 2010/11/18
* @author Ludo Helder
* @version 1.0.1
View README.markdown

#link 没有 charset 属性

相信不少人都见过下面的 link 代码片段:

<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" />

其中比较陌生的是 charset 属性。在 [HTML 4.01 的规范文档中][1]有这样的记述: