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 / del-console.sh
Created October 9, 2013 15:14
Clear "console.log" before `git commit`, and recover them after `git commit`, add them to git-hooks file: pre-commit & post-commit ~
#!/bin/sh
debug_rex='/console.log/'
debug_print_rex=$debug_rex'p'
debug_del_rex=$debug_rex' d'
add_debug_patch='.add-debug.patch'
del_debug_patch='.del-debug.patch'
git_work_dir="$(git rev-parse --show-toplevel)"
fake_file="$git_work_dir/.fake_file"
cur_dir="$(pwd)"
@houkanshan
houkanshan / track.js
Created October 11, 2013 15:22
get stack
// https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
function customPrepare(error, trace) {
return trace
}
function getStack() {
var stack
var oldPrepare = Error.prepareStackTrace
Error.prepareStackTrace = customPrepare
// background transparency
background-transparency(color, alpha = 1)
ms-color = argb(color, alpha)
background rgb(color)
background rgba(color, alpha)
.lt-ie8 &
zoom 1
.lt-ie9 &
background transparent
filter s('progid:DXImageTransform.Microsoft.gradient(startColorstr=%s,endColorstr=%s)', ms-color, ms-color)
@houkanshan
houkanshan / index.html
Last active August 29, 2015 13:56
microphone demo.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<canvas></canvas>
<span class="count"></span>
From 28e484469ef9fcee1bdd1820afc1897a0b60ba91 Mon Sep 17 00:00:00 2001
From: houmai <[email protected]>
Date: Wed, 26 Feb 2014 10:49:17 +0800
Subject: [PATCH] add self as keyword.
---
syntax/javascript.vim | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/syntax/javascript.vim b/syntax/javascript.vim
#!/bin/bash
for (( i=0; i<100; i++ )); do
echo $i
convert \
-size 165x165 \
xc:white \
-pointsize 100 \
-fill black\
-gravity center \
// ==UserScript==
// @name hide douban feeds
// @namespace http://houkanshan.github.io/
// @version 0.6.0
// @description I dont care.
// @match http*://www.douban.com/*
// @require http://libs.baidu.com/underscore/1.3.3/underscore-min.js
// @require http://libs.baidu.com/jquery/2.0.3/jquery.min.js
// @copyright 2014+, Houkanshan
// ==/UserScript==
function key(c) {
$('#drums [data-pitch='+(c - 1)+']').click()
}
setInterval(play, 200)
var list1 = [[3,4], [], [4], [], [2], [] , [4], [2], [4], [2], [1], [], [2, [4]],[], [4], []]
var list2 = [[1, 3], [4], [2, 4], [4], [1, 4], [1, 4], [2, 4], [4]]
var i = 0;
list = list1
function play(){
i = i % list.length
char_group .close {
float: none;
font-size: inhert;
font-weight: inhert;
line-height: inhert;
color: inhert;
text-shadow: inhert;
filter: inhert;
opacity: inhert;
}