Skip to content

Instantly share code, notes, and snippets.

View mytharcher's full-sized avatar
🏠
Working from home

Junyi mytharcher

🏠
Working from home
View GitHub Profile
@mytharcher
mytharcher / extracts.md
Created January 11, 2012 12:32
Extracts
@mytharcher
mytharcher / tips-of-jekyll.md
Created January 15, 2012 14:37
Tips of jekyll

Tips of jekyll

Here record some tips of jekyll when I set up sites with it.

[jekyll]

  1. No BOM! UTF-8 BOM in Windows' text editors would bring any post with YAML head matter down!
  2. When put any posts out of /_posts folder, the category can not set. And the category would be the folder name which the post put in.
  3. Pagination permalink must be /pageN/ and use /index.html for index. Can not customize as /blog/page/N/. (Issue here)
@mytharcher
mytharcher / html5tags.js
Created March 3, 2012 16:53
JS检测HTML5的标签兼容性
/*
* jslib JavaScript Library
*
* create:
* @2011-07-28 by mytharcher
*
* update:
*/
///import js.client.Features;
@mytharcher
mytharcher / ClassName.js
Created March 3, 2012 17:07
jslib原版不依赖Set类的dom.ClassName实现
/*
* elf JavaScript Library
*
* create:
* @2010-2-27 By mytharcher
*
* update:
* @2010-04-12 By mytharcher
* @2010-04-20 By mytharcher
* @2010-04-27 By mytharcher
@mytharcher
mytharcher / Path.js
Created March 3, 2012 17:25
jslib路径计算
/*
* jslib JavaScript Library
*
* create:
* @2011-11-30 by mytharcher
*
* update:
*/
///import js.util.Class;
@mytharcher
mytharcher / compressor.rb
Last active May 10, 2022 01:56
A jekyll plugin for compressing HTML, JavaScript files when rendering.
#
# File compressor plugin for jekyll
# =================================
#
# By [mytharcher](https://github.com/mytharcher)
# 2012-05-20
#
# Updated by [nicoespeon](https://github.com/nicoespeon)
# 2013-04-12
#
@mytharcher
mytharcher / references.rb
Last active October 5, 2015 05:47 — forked from olov/references.rb
Jekyll markdown references plugin by Olov Lassus: Keep all your markdown reference-style link definitions in one file (_references.md)
# references.rb: jekyll markdown references plugin
#
# add this file to your _plugins directory (create it if needed)
# create a file (exactly) named _references.md in your Jekyll site root,
# then add your markdown reference-style link definitions to it.
# for example:
# [jsshaper]: http://jsshaper.org "an extensible framework for JavaScript syntax tree shaping"
#
# you can now reference these links in any markdown file
# for example:
@mytharcher
mytharcher / er-package.sh
Created August 10, 2012 09:13
Web assets package script for ER project
#!/bin/sh
WORK_BASE=$(pwd)
CLIENT_DIR=$WORK_BASE/un-web-client/src/main/webapp
TEMP_DIR=$WORK_BASE/building_temp
cd $CLIENT_DIR
### process *.html -> tpl.html
sed 's/.*"\(.*\.html\)".*/\1/' "assets/js/~template.js" | grep tpl | xargs cat |
@mytharcher
mytharcher / authorization.js
Created November 7, 2012 15:16
A demo testing HTTP 401 authorization on node.js
var approot = process.env.PWD;
var db = require(approot + '/lib/db');
var encrypt = require(approot + '/lib/encrypt');
exports = module.exports = function (req, res, next) {
console.log('processing authorization...');
var session = req.session;
@mytharcher
mytharcher / fix-win2mac-txt.sh
Created November 28, 2012 00:26
Common shells
#!/bin/bash
#Change all txt file from Windows form to Max form.
for post in $(find . -type f)
do
# echo $post
cat $post > temp.md
mv -f ./temp.md $post
done