Skip to content

Instantly share code, notes, and snippets.

@derky1202
derky1202 / wp-xml-octopress-import.rb
Created January 4, 2012 09:20 — forked from tnmt/wp-xml-octopress-import.rb
Import XML of Wordpress to Octopress
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
@derky1202
derky1202 / category_list.rb
Created January 23, 2012 08:22 — forked from nistude/category_list.rb
A category list tag for jekyll
# place this file in your plugins directory and add the tag to your sidebar
#$ cat source/_includes/asides/categories.html
#<section>
# <h1>Categories</h1>
# <ul id="categories">
# {% category_list %}
# </ul>
#</section>
module Jekyll
@derky1202
derky1202 / categories.html
Created January 24, 2012 02:03
用于设立category list,请将该文件放入 source/_includes/asides/
<section>
<h1>Categories</h1>
<ul id="categories">
{% category_list %}
</ul>
</section>
@derky1202
derky1202 / head.html
Created September 5, 2012 05:26
source/_includes/custom/head.html
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Ruge+Boogie|Ruthie|Flavors|Rancho|Galdeano' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Philosopher:[object Object],[object Object],[object Object],[object Object]' rel='stylesheet' type='text/css'>
@derky1202
derky1202 / _fonts.scss
Created September 5, 2012 05:28
sass/custom/_fonts.scss
// Here you can easily change font faces which are used in your site.
// To give it a try, uncomment some of the lines below rebuild your blog, and see how it works. your sites's.
// If you love to use Web Fonts, you also need to add some lines to source/_includes/custom/head.html
//$sans: "Optima", sans-serif;
//$serif: "Baskerville", serif;
//$mono: "Courier", monospace;
//$heading-font-family: "Verdana", sans-serif;
//$header-title-font-family: "Futura", sans-serif;
//$header-subtitle-font-family: "Futura", sans-serif;
@derky1202
derky1202 / _style.scss
Created September 5, 2012 08:45
sass/custom/_style.scss
// This File is imported last, and will override other styles in the cascade
// Add styles here to make changes without digging in too much
@media only screen and (min-width: 550px) {
body > header h2 { padding-left: 60px; }
body > footer { margin-bottom: 3em; }
}
<?php
if(function_exists('posix_geteuid')){
// use posix to get current uid and gid
$uid = posix_geteuid();
$usr = posix_getpwuid($uid);
$user = $usr['name'];
$gid = posix_getegid();
$grp = posix_getgrgid($gid);
$group = $grp['name'];