Skip to content

Instantly share code, notes, and snippets.

View houkanshan's full-sized avatar
👾
My game is Mai and I like making names

Mai Hou houkanshan

👾
My game is Mai and I like making names
View GitHub Profile
@houkanshan
houkanshan / test
Created March 28, 2012 04:31
test
haha
@houkanshan
houkanshan / git config
Created March 28, 2012 07:58
git conf
git config --global user.name "houkanshan"
git config --global user.email "xxx"
git config --global color.ui true
git config --global core.editor "vim"
git config --global alias.co checkout
@houkanshan
houkanshan / dt_status.js
Created April 13, 2012 11:50
发一个蛋疼的状态(你说我改个小东西github也要发个新鲜事,好蛋疼啊??)
//用这个在人人发状态, 可以做到........ 让你的最近一条状态为'什么也没做...'
//支持renren新旧版本.
//呵呵
(function(document){
var h_iframes = document.getElementsByTagName('iframe');
var proxy;
var id;
var patten = /status/g;
var text = document.getElementsByClassName('status-content')[0].value;
@houkanshan
houkanshan / google_black_list.js
Created May 31, 2012 18:56 — forked from wong2/google_black_list.js
Google Chinese blacklist
var a = [[1492], [6656], [8759], [63166], [9287], [4369], [8811], [7556], [6262], [14399], [64357], [64353], [10546], [6450], [63794], [61408], [60467, 60463, 30321, 30325, 5103, 9471, 8510, 30243, 5103, 9471, 8510, 30321, 30325, 60467, 60463], [63413, 878, 10006, 64901], [57367, 10006, 64901, 14548, 14505], [10006, 64901, 30321, 30325, 6877, 9480, 30243, 6877, 9480, 30321, 30325, 10006, 64901], [57367, 10006, 64901, 30321, 30325, 14624, 61401, 30243, 14624, 61401, 30321, 30325, 57367, 10006, 64901], [62995, 4015, 62638, 64946, 30321, 30325, 3339, 7703,
30243, 3339, 7703, 30321, 30325, 62995, 4015, 62638, 64946], [10035, 9470, 8711, 30321, 30325, 3339, 7703, 30243, 3339, 7703, 30321, 30325, 10035, 9470, 8711], [62427, 643, 643], [6952, 14674, 10728], [10851, 10827, 14674, 10728], [30263, 30266, 30246, 30248, 30256, 30256, 30267], [30257, 30266, 30262, 30259, 30321, 30325, 30248, 30256, 30256, 30267, 30243, 30248, 30256, 30256, 30267, 30321, 30325, 30257, 30266, 30262, 30259], [12150, 2272, 11
@houkanshan
houkanshan / less.js
Created July 21, 2012 00:00
auto complie less
/* less.js
* detect files change and lessc it
*
* usage: node less.js [-x] INFILE -d OUTFILE
* */
var fs = require('fs'),
walk = require('walk'),
exec = require('child_process').exec,
path = require('path');
@houkanshan
houkanshan / gist:3485400
Created August 27, 2012 04:01
bash_theme
# colors defined with tput
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "(git:"${ref#refs/heads/}")"
}
# must put \[ and \] around any non-printing escape sequences
# http://mywiki.wooledge.org/BashFAQ/053
export PS1="\[\e[1;34m\][\t]""\[\e[1;32m\]\u""\[\e[0;0m\]@""\[\e[1;32m\]\H""\[\e[0;0m\]:\w\n\[\e""[0;36m\]\$(git_branch)\$""\[\e[0;0m\] "
@houkanshan
houkanshan / test.html
Created September 6, 2012 15:41
限制单实例运行
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="./test.js" type="text/javascript"></script>
</head>
<body>
<span id="test"></span>
</body>
@houkanshan
houkanshan / gist.rb
Created October 6, 2012 13:27
gist in jekyll
# From https://github.com/mojombo/jekyll/issues/463
# but run error on my jekyll.
# add a comments to stop jekyll auto omit the 'script' end-tag
# usage {% gist gist_id %}
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, tokens)
@houkanshan
houkanshan / index.slim
Created February 4, 2013 13:07
A CodePen by MieMie. Hexagon image - css3 + html
div.box
div.inner1
div.inner2
@houkanshan
houkanshan / git-multi-cherry-pick.sh
Created May 3, 2013 08:08
git-multi-cherry-pick
#!/bin/bash
# for git < 1.7.2
# from http://stackoverflow.com/questions/1994463/how-to-cherry-pick-a-range-of-commits-and-merge-into-another-branch/1994491#1994491
if [ -z $1 ]; then
echo "Equivalent to running git-cherry-pick on each of the commits in the range specified.";
echo "";
echo "Usage: $0 start^..end";
echo "";