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
display_errors = On, | |
error_reporting = 2047, | |
short_open_tag = Off, | |
memory_limit = 512M, | |
allow_url_fopen = On, | |
post_max_size = 1024M, | |
max_file_uploads = 1000, | |
upload_max_filesize = 1024M, |
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"?> | |
<phpunit backupGlobals="false" | |
backupStaticAttributes="false" | |
colors="true" | |
convertErrorsToExceptions="true" | |
convertNoticesToExceptions="true" | |
convertWarningsToExceptions="true" | |
processIsolation="false" | |
stopOnFailure="false" | |
syntaxCheck="false" |
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
# From http://my.oschina.net/michaelyuanyuan/blog/68616 | |
# Set a download dir | |
download_dir=~/downloads | |
# Install H264 encoder | |
cd $download_dir | |
git clone git://git.videolan.org/x264.git x264 | |
cd x264 |
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
# 请注意修改部分参数,如安装mysql-server时,设置 MySQL root 密码,以便自动安装 | |
# System related | |
sudo apt-get update | |
sudo apt-get -y install build-essential ssh curl software-properties-common python-software-properties python g++ make | |
# Editor | |
sudo apt-get -y install vim | |
# VCS |
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
{ | |
"require": { | |
"silex/silex": "1.1.*@dev", | |
"respect/validation": "dev-develop", | |
"symfony/browser-kit": "2.4", | |
"monolog/monolog": "1.6.*@dev", | |
"cartalyst/sentry": "2.0.*", | |
"illuminate/database": "4.1.*", | |
"ircmaxell/password-compat": "*", | |
"gabordemooij/redbean": "dev-master" |
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
// From http://stackoverflow.com/questions/476679/preloading-images-with-jquery | |
function preload(arrayOfImages) { | |
$(arrayOfImages).each(function(){ | |
$('<img/>')[0].src = this; | |
// Alternatively you could use: | |
// (new Image()).src = this; | |
}); | |
} |
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 | |
/** | |
* 加密 hash,生成发送给用户的 hash 字符串 | |
* | |
* @param array $hash_data | |
* @param string $hash_key | |
* @return string | |
*/ | |
function encode_hash($hash_data, $hash_key = false) |
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
sudo apt-get update | |
sudo apt-get install build-essential vim gvim git gitk | |
mkdir ~/temp | |
mkdir ~/app | |
# 安装 chrome | |
sudo apt-get install chromium-browser | |
# 安装 sublime text | |
cd ~/temp |
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
function check_username($username) { | |
$guestexp = ‘\xA1\xA1|\xAC\xA3|^Guest|^\xD3\xCE\xBF\xCD|\xB9\x43\xAB\xC8′; | |
$len = $this->dstrlen($username); | |
if($len > 15 || $len < 3 || preg_match(“/\s+|^c:\\con\\con|[%,\*\"\s\<\>\&]|$guestexp/is”, $username)) { | |
return FALSE; | |
} else { | |
return TRUE; | |
} | |
} |
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 | |
/** | |
* PDF2PNG | |
* @param $pdf 待处理的PDF文件 | |
* @param $path 待保存的图片路径 | |
* @param $page 待导出的页面 -1为全部 0为第一页 1为第二页 | |
* @return 保存好的图片路径和文件名 | |
*/ | |
function pdf2png($pdf,$path,$page=-1) | |
{ |