Skip to content

Instantly share code, notes, and snippets.

@yanping
yanping / generate_archives.rb
Created November 27, 2011 17:58 — forked from stympy/generate_archives.rb
Archive generator plugin for jekyll
# Jekyll archive page generator with pagination.
#
# Based on the category generator from
# http://recursive-design.com/projects/jekyll-plugins/,
# which is copyright (c) 2010 Dave Perrett,
# http://recursive-design.com/ and is licensed under the MIT
# license (http://www.opensource.org/licenses/mit-license.php), and
# on the pagination code from Jekyll itself.
#
# This code is copyright (c) 2011 Benjamin Curtis, and is licensed
@yanping
yanping / error_shell.sh
Created December 1, 2011 03:15
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)>'
@yanping
yanping / default.html
Created December 15, 2011 12:55
default.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title> {% if page.title %} {{ page.title }} | {% endif %} John Doe, Photographer </title>
<link rel="stylesheet" href="/css/styles.css" />
</head>
<body>
<div id="main">
{{ page.title }}{% if page.title %} | {% endif %}
@yanping
yanping / portfolio_entry.html
Created December 15, 2011 12:59
portfolio_entry.html
---
layout: default
---
<h2 class="content">{{page.title}}</h2>
<img src="{{ page.image }}" />
{{ content }}
@yanping
yanping / index.html
Created December 15, 2011 13:00
index.html
---
layout: default
title: Portfolio
---
<section class="content">
<h2>Portfolio</h2>
<p>Check out my images below!</p>
</section>
@yanping
yanping / table_test.html
Created January 4, 2012 08:12
Table HTML
<table border="1">
<tr>
<th>ID</th><th>Name</th><th>Rank</th>
</tr>
<tr>
<td>1</td><td>Tom Preston-Werner</td><td>Awesome</td>
</tr>
<tr>
<td>2</td><td>Albert Einstein</td><td>Nearly as awesome</td>
</tr>
@yanping
yanping / save-old-installed-packages.r
Created January 6, 2012 05:52
save old installed packages
oldip <- installed.packages()[ ,1]
save(oldip, file="path/installedPackages.Rdata")
@yanping
yanping / install-new-packages.r
Created January 6, 2012 05:57
install new packages
load("path/installedPackages.Rdata")
newip <- installed.packages()[,1]
for(i in setdiff(oldip, newip))
install.packages(i)
@yanping
yanping / Rprofile.site
Created January 9, 2012 14:15
Sample Rprofile.site file
# 设置常用选项
options(papersize="a4")
options(editor="notepad")
options(pager="internal")
options(tab.width = 2)
options(width = 130)
options(graphics.record=TRUE)
options(show.signif.stars=FALSE)
# 设置R交互提示信息