Skip to content

Instantly share code, notes, and snippets.

View h2ero's full-sized avatar

h2ero

  • Beijing,China
View GitHub Profile
@h2ero
h2ero / gist:3623652
Created September 4, 2012 17:13
vim
http://jiazhoulvke.com/?p=111
:UseVimball ~/.vim/bundle/plugin_name
@h2ero
h2ero / gist:3760661
Created September 21, 2012 09:46
mac notes

os version: cat /System/Library/CoreServices/SystemVersion.plist

@h2ero
h2ero / gist:3879550
Created October 12, 2012 14:45
ubuntu script
#!/bin/sh
args=$@
path=${args#vim}
gnome-terminal -e "vim $args"
#!/bin/sh
args=$@
${args#vim}
body{
background: #000;
font-family: Georgia, Palatino, serif;
color: #EEE;
line-height: 1;
padding: 30px;
margin:auto;
max-width:42em;
}
h1, h2, h3, h4 {
<?php
/**
* POWER PHLOGGER Shared Library
* Pixel generation class
*
* output of 1 pixel transparent/color gif
* call this file directly in an IMG-tag.
* syntax: <img src="phpixel.php"> for a transparent pixel
* or: <img src="phpixel.php?c=FFFF00"> yellow
*
<?php
/**
* PHP gen redis protocol function
* author: h2ero <122750707@qq.com>
* date: 2013-07-24 15:01:42
* useage: php gen_redis_proto.php | redis-cli --pipe
*/
function gen_redis_proto()
{
$CRLF = "\r\n";
! emulate XTerm for proper recognition of key combinations in Vim
!URxvt.keysym.Up : \033[A !breaks arrow keys in Vim
!URxvt.keysym.Down : \033[B !breaks arrow keys in Vim
!URxvt.keysym.Right : \033[C !breaks arrow keys in Vim
!URxvt.keysym.Left : \033[D !breaks arrow keys in Vim
!URxvt.keysym.Page_Up : \033[5~ !breaks scrolling in Rxvt
!URxvt.keysym.Page_Down : \033[6~ !breaks scrolling in Rxvt
!URxvt.keysym.Home : \033[H !breaks navigation in Vim
!URxvt.keysym.End : \033[F !breaks navigation in Vim
URxvt.keysym.S-Up : \033[1;2A
#! /bin/sh
# awk export mysql table info with markdown table
awk '
BEGIN{
}
{
if($0~/CREATE/){
gsub("`", "", $6)
print "### "$6
print "\n"
#! /bin/sh
find ./ -iname "*html" | xargs -i sed -i '{
s/\(<li>\)\(.*\): \(<a.*>\)\(.*\)\(<\/a>\)/\1\4\3\2\5/
}' {}
<?php
interface Worker
{
public function getCommand();
public function done($stdout, $stderr);
public function fail($stdout, $stderr, $status);
}