Skip to content

Instantly share code, notes, and snippets.

View h2ero's full-sized avatar

h2ero

  • Beijing,China
View GitHub Profile
{"sJump_positions":{"s.weibo.com":[{"cssPath":"div#pl_common_searchTop","method":"after"}],"cn.bing.com":[{"cssPath":"form#sb_form","method":"after"}],"www.baidu.com":[{"cssPath":"form#form","method":"after"}],"www.so.com":[{"cssPath":"div#head","method":"after"}],"www.google.com":[{"cssPath":"div#hdtbSum","method":"after"}],"developer.mozilla.org":[{"cssPath":"form#search-form > div.results-search-form","method":"after"}],"www.douban.com":[{"cssPath":"div#db-nav-sns","method":"after"}],"book.douban.com":[{"cssPath":"div#db-nav-book","method":"after"}]},"sJump_searchs":{"YmFpZHU=":{"url":"http://www.baidu.com/s?wd=","enable":true,"favicon":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB30lEQVQ4jY2TP2gTcRTHn2AltOaurcUqFq0iSIR0yKABB0VwKeKgiHEwLoJQEDdBrENdnDsIgrNYq9WCYpUg4lDEyb/Fxd671KaxsZikh5qmTT4OF689cyf+4A3v8d7n+/u9Lz+JJ8mIoUhkTXQom3ptxGzkrW7N12Mo8SQZEUMJOk+eOr58pdbcI4YiEmkGpM7mEbG4dKUAwKkzeUSmefOu4gdEQgDSZbO7L8v+Q7NMfVpC2pUde23ODXwNBzhOjdGxsquYziMbLC5fLfD2fQURC4kqI/fK4YBUOo9ElWMnc1SX4
#!/bin/bash
while [[ 1 == 1 ]]; do
if [[ $(ip a | grep ppp0 | grep -v DOWN) != '' ]]; then
exit;
fi
if [[ $(ip a | grep ppp0) == '' ]]; then
pon h2ero
fi
sleep 1
<?php
$parseDsn = function($pdoDsn)
{
$dsnInfo = parse_url($pdoDsn);
if ( empty($dsnInfo['scheme'])) {
throw new \Exception("invalid dsn:$pdoDsn");
}
$pathInfo = explode(';', $dsnInfo['path']);
foreach ($pathInfo as $p) {
$itemInfo = explode('=', $p);
110000 北京市
110100 市辖区
110101 东城区
110102 西城区
110105 朝阳区
110106 丰台区
110107 石景山区
110108 海淀区
110109 门头沟区
110111 房山区
align
breeze.vim
conque
ctrlp-funky
ctrlp-google
ctrlp-hg
ctrlp.vim
cvimdoc
dbext.vim
DBGp-Remote-Debugger-Interface
@h2ero
h2ero / 1.sh
Last active August 29, 2015 13:57
pandoc_cjk.tex
#pandoc 1.12.3.3
pandoc user.md -s --listings --latex-engine=xelatex -o pdf.pdf --latex-engine=xelatex --template=/home/h2ero/pandoc.latex
<?php
$arrayDiff = function($arr1, $arr2) use (&$arrayDiff) {
foreach ($arr1 as $k => $a1) {
if ( ! isset($arr2[$k])) {
continue;
}
if (is_array($arr1[$k])) {
return $arrayDiff($arr1[$k], $arr2[$k]);
} else {
if ((string)$arr1[$k] != (string)$arr2[$k]) {
#!/bin/bash
for (( i = 1; i < 222222222; i+=1000 )); do
m=$(($i+1000))
php ./testModule.php $i $m &
num=$(ps -ef | grep testModule | wc -l)
while [[ $num -ge 100 ]]; do
echo $num
sleep 2
num=$(ps -ef | grep testModule | wc -l)
if [[ $num -le 100 ]]; then
<?xml version="1.0"?>
<ruleset name="PHP_Codesniffer Plugins PHPCS">
<rule ref="PSR"/>
<rule ref="PSR1"/>
<rule ref="PSR2"/>
<rule ref="Generic.Files.ByteOrderMark"/>
<!-- Use Unix newlines -->
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
# markdown2org
find . | grep '\.md$' | xargs -i \
sed -i '
/```/,/```/ !{
#unorder list
s/^\s*\*/+/
#title
s/^####\s*\(.*\)\s*$/**** \1/
s/^###\s*\(.*\)\s*$/*** \1/
s/^##\s*\(.*\)\s*$/** \1/