This file contains 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 dir_writeable($dir) { | |
$writeable = 0; | |
if(!is_dir($dir)) { | |
@mkdir($dir, 0777); | |
} | |
if(is_dir($dir)) { | |
if($fp = @fopen("$dir/test.txt", 'w')) { | |
@fclose($fp); | |
@unlink("$dir/test.txt"); | |
$writeable = 1; |
This file contains 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 isemail($email) { | |
return strlen($email) > 6 && strlen($email) <= 32 && preg_match("/^([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-]+[.][A-Za-z0-9\-.]+)$/", $email); | |
} |
This file contains 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 size_format( $bytes, $decimals = 0 ) { | |
$quant = array( | |
// ========================= Origin ==== | |
'TB' => 1099511627776, // pow( 1024, 4) | |
'GB' => 1073741824, // pow( 1024, 3) | |
'MB' => 1048576, // pow( 1024, 2) | |
'kB' => 1024, // pow( 1024, 1) | |
'B ' => 1, // pow( 1024, 0) | |
); | |
foreach ( $quant as $unit => $mag ) |
This file contains 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
::方便调试set cur_path = %cd% | |
e: | |
cd e:\www\CGBT2 | |
git checkout gh-pages | |
php e:\www\newcgbt_release\v2.0\tools\db_dict_generator.php | |
move C:\Users\Lee\Desktop\db_dict.html e:\www\CGBT2 | |
git add db_dict.html | |
git commit -am "generate database dict, %date:~0, 10%" | |
git push origin gh-pages | |
git checkout master |
This file contains 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
# coding=utf-8 | |
from urllib import request | |
from urllib import parse | |
from http import cookiejar | |
username = 'your_username' | |
password = 'your_password' | |
login_url = 'https://fengcheco.com/auth/identity/callback' | |
project_id = 'your_project_id' | |
iteration_id = 'your_iteration_id' |
This file contains 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 | |
require './source/class/class_core.php'; | |
$discuz = & discuz_core::instance(); | |
$discuz->init(); | |
$credit = & credit::instance(); | |
$sql = 'select uid from ' . DB::table('common_member'); | |
$users = DB::fetch_all($sql); | |
//重新计算用户积分 |
This file contains 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 | |
/** | |
* IP 地理位置查询类 | |
* | |
* @author joyphper | |
* @version 1.0 | |
* @copyright 2010 joyphper.net | |
*/ | |
This file contains 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 | |
define("DES_KEY", "SCUBEPGW"); | |
define("HASH_PAD", "0001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff003021300906052b0e03021a05000414"); | |
bcscale(0); | |
$private_key = array(); | |
if (!function_exists('hex2bin')) | |
{ | |
function hex2bin($hexdata) | |
{ | |
$bindata = ''; |
This file contains 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 | |
// Use in the "Post-Receive URLs" section of your GitHub repo. | |
if ( $_POST['payload'] ) { | |
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull 2>& 1' ); | |
echo 'success'; | |
} |
This file contains 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
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
/** |
OlderNewer