Skip to content

Instantly share code, notes, and snippets.


Yanping Chen yanping

View GitHub Profile
yanping / generate_archives.rb
Created Nov 27, 2011 — forked from stympy/generate_archives.rb
Archive generator plugin for jekyll
View generate_archives.rb
# Jekyll archive page generator with pagination.
# Based on the category generator from
# which is copyright (c) 2010 Dave Perrett,
# and is licensed under the MIT
# license (, and
# on the pagination code from Jekyll itself.
# This code is copyright (c) 2011 Benjamin Curtis, and is licensed
yanping /
Created Dec 1, 2011
Why I couldn't generate the Octopress blog
root@ypchen-ubuntu:~/octopress# rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse YAML at line 20 column 0 (Psych::SyntaxError)
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:119:in `parse'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:106:in `load'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:205:in `load_file'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll.rb:119:in `configuration'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/bin/jekyll:207:in `<top (required)>'
View default.html
<!DOCTYPE html>
<meta charset=utf-8 />
<title> {% if page.title %} {{ page.title }} | {% endif %} John Doe, Photographer </title>
<link rel="stylesheet" href="/css/styles.css" />
<div id="main">
View if statement
{{ page.title }}{% if page.title %} | {% endif %}
View portfolio_entry.html
layout: default
<h2 class="content">{{page.title}}</h2>
<img src="{{ page.image }}" />
{{ content }}
View index.html
layout: default
title: Portfolio
<section class="content">
<p>Check out my images below!</p>
View table_test.html
<table border="1">
<td>1</td><td>Tom Preston-Werner</td><td>Awesome</td>
<td>2</td><td>Albert Einstein</td><td>Nearly as awesome</td>
View save-old-installed-packages.r
oldip <- installed.packages()[ ,1]
save(oldip, file="path/installedPackages.Rdata")
View install-new-packages.r
newip <- installed.packages()[,1]
for(i in setdiff(oldip, newip))
yanping /
Created Jan 9, 2012
Sample file
# 设置常用选项
options(tab.width = 2)
options(width = 130)
# 设置R交互提示信息
You can’t perform that action at this time.