This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------------------------------------------------ | |
Global Styles | |
------------------------------------------------------------------------------------*/ | |
* { | |
padding:0; | |
margin:0; | |
} | |
h1, h2, h3, h4, h5, h6, p, pre, blockquote, label, ul, ol, dl, fieldset, address { margin:1em 0; } | |
li, dd { margin-left:5%; } | |
fieldset { padding: .5em; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Author: Lynn | |
* Email: homlean(at)gmail.com | |
*/ | |
Route::get( | |
'test', function () { | |
$config = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<code_scheme name="Lynn"> | |
<option name="OTHER_INDENT_OPTIONS"> | |
<value> | |
<option name="INDENT_SIZE" value="2" /> | |
<option name="CONTINUATION_INDENT_SIZE" value="2" /> | |
<option name="TAB_SIZE" value="2" /> | |
<option name="USE_TAB_CHARACTER" value="false" /> | |
<option name="SMART_TABS" value="false" /> | |
<option name="LABEL_INDENT_SIZE" value="0" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PRC looks like '爬入场'; | |
// Hoho~ | |
date_default_timezone_set('PRC'); | |
var_dump(DateTime::createFromFormat('Ymd', '20130229')); | |
/* | |
Result: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -name "*.xml" | while read name; do | |
echo $name | |
iconv -f GB2312 -t UTF-8 $name > ${name}.utf8 | |
mv $name ${name}.gb2312 | |
mv ${name}.utf8 $name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_time_limit(0); | |
$url = | |
'http://cn.bing.com/search?q=site%3apinyin.cn&qs=n&pq=site%3apinyin.cn&sc=0-4&sp=-1&sk=&first={ddddd}1&FORM=PERE'; | |
$i = $_GET['i']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.gz; do | |
mv $file `basename $file .gz`.zip; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.xml; do | |
is_head_xml=$(head -n 1 $file | grep -e '<?xml') | |
if [ -z "$is_head_xml" ]; then | |
echo $file | |
else | |
sed '1s/^.*$/<?xml version="1.0" encoding="utf-8"?>/' $file > ./output/$file | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
loose_comparison('github'); // github.com | |
strong_comparison('github'); // github.com | |
loose_comparison(0); // github.com | |
strong_comparison(0); // Oops! NSA... | |
function loose_comparison($str) { | |
switch ($str) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 先来定义一个数组,并尝试输出其结果 | |
> var a = [1, 2, 3]; | |
> a | |
[1, 2, 3] | |
// 目前来看一切正常,没有任何问题 | |
// ok,开始做点有意思的事 | |
> a[-1] = 4; | |
// 数组发生变化了吗? | |
> a |
OlderNewer