Skip to content

Instantly share code, notes, and snippets.

View AndorChen's full-sized avatar
💭
I may be slow to respond.

Andor Chen AndorChen

💭
I may be slow to respond.
View GitHub Profile
@AndorChen
AndorChen / fonts.md
Last active November 15, 2022 08:23
电子书制作

O'REILLY系列图书排版要求:

字体(均为汉仪字体)和字号(均为苹果字号)

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

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

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

def hello
puts 'hello'
end
require 'json'
class String
def camelize
string = self
string.split('_').map(&:capitalize).join('')
end
end
module PandocFilter
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")
end
unless ENV['file'].end_with?('.epub')
/*
Prince - Fonts stylesheet
http://www.princexml.com
*/
/* standard "serif" font family */
@font-face {
font-family: serif;
src: local("Arial Unicode MS") /* last resort font */
@AndorChen
AndorChen / functions.php
Created January 17, 2012 04:18
Add Links to WordPress 3.3 New Toolbar
<?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',
<?php
add_action('after_setup_theme', 'ac_theme_setup');
function ac_theme_setup(){
// 自定义导航菜单
register_nav_menu('top', '顶部菜单');
}
?>
@AndorChen
AndorChen / README.textile
Created December 16, 2011 10:43
What fonts and charset do you use?

一些站点使用的字体统计

站点 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
AndorChen / jquery.html5.placeholder.js
Created December 9, 2011 05:25
jQuery HTML5 Placeholder fix
/**
* jQuery.HTML5 placeholder - Placeholder plugin for input fields
* Written by Ludo Helder (ludo DOT helder AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2010/11/18
*
* @author Ludo Helder
* @version 1.0.1
*
**/
@AndorChen
AndorChen / README.markdown
Created December 2, 2011 04:26
No charset in link

#link 没有 charset 属性

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

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

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