Skip to content

Instantly share code, notes, and snippets.

Peng Qi perrywky

Block or report user

Report or block perrywky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@perrywky
perrywky / check_discuz_spam.php
Created Jan 9, 2013
扫描discuz里的垃圾帖
View check_discuz_spam.php
<?php
/*
* 扫描论坛垃圾帖放入回收站
* 使用levenshtein算法判断字符串相似度
* 相似度超过0.85的主题,数量超过2条,则会被放入回收站
* 每隔5分钟取最新的100个主题检查
* 在/tmp/bbs_spam.log记录所有被删除的主题
*
* @author Perry
*/
@perrywky
perrywky / change_discuz_username_length.php
Created Sep 5, 2012
修改discuz用户名字段长度限制
View change_discuz_username_length.php
<?php
//Discuz X 2.0版本
$dbhost = 'localhost';
$dbuser = '';
$dbpass = '';
$dbname = '';
$prefix = 'pre_';
$length = 30;
@perrywky
perrywky / change_ucenter_username_length.php
Created Sep 5, 2012
修改ucenter用户名字段长度限制
View change_ucenter_username_length.php
<?php
//ucenter 1.6.0版本
$dbhost = 'localhost';
$dbuser = '';
$dbpass = '';
$dbname = '';
$prefix = 'uc_';
$length = 30;
@perrywky
perrywky / gist:1851844
Last active Sep 30, 2015
jQuery.enter(fun)
View gist:1851844
//jQuery扩展,当用户按了回车键后,会触发函数
(function($){
$.fn.enter = function(fun){
if($.isFunction(fun)){
this.keypress(function(e){
if(e.keyCode == 13){
fun.call(this, e);
}
});
}
You can’t perform that action at this time.