javascript async load
[php]<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>[/php]
async, javascript, load阅读全文
preg_match匹配长度限制
preg_match正则在比较长的字符串中提取目标内容时,有时会发现提取不到目标,有可能就是遇到了preg_match匹配长度限制
涉及php.ini配置:“pcre.backtrack_limit ”,默认只设了100000。
php动态设置方法:
[php]ini_set('pcre.backtrack_limit', 999999999);
注:这个参数在php 5.2.0版本之后可用。[/php]
相关设置:pcre.recursion_limit, pcre.recursion_limit是PCRE的递归限制,这个项如果设很大的值,会消耗所有进程的可用堆... pcre.backtrack_limit, preg_match匹配长度, preg_match匹配长度限制阅读全文
domain details 2.7修正
火狐升级到30.0版本之后,doamin details 2.7插件出现不兼容的情况,有的情况是打开网页时不断报错使得网页无法正常浏览,有的情况是网页正常但无法显示IP地址及国家图标,我对此作了修正,现提供下载如下:[download id="1"]
domain details, firefox, 插件, 火狐阅读全文
Creative Cloud文件导出、备份
使用Creative Cloud安装Adobe软件(Photoshop、Dreamweaver等)后,好不容易下载完成的安装文件会被清理干净,为了备份器安装文件,以备以后重装,特写了如下脚本,保存为backupadobe.cmd,当Creative Cloud安装动作全部完成时Ctrl-C终止即可。脚本内容如下:
[php]cd/d C:\Users\%USERNAME%\AppData\Local\Temp
set count=0
:redo
dir /a-d /b /s /od|find ".7z"|find /v "aamdownload">t_t.txt
for /F %... Adobe, Creative Cloud阅读全文
byterun解码程序php源代码
在php中遇到形如$_F=__FILE__;$_X=的编码文件时,我们需要解码才能还原原始代码,这种形式的编码方式称作:byterun编码,以下为解码源代码:
[php]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=UTF-8" http-equiv="Content-Type">
<?php
$self=__FILE__;
$fn='';
if (isset($_GET['fn'])){
$fn... $_F=__FILE__;$_X=, byterun, byterun decoder, byterun解码阅读全文
LNMP记录PHP错误
1.修改php-fpm.conf中配置 没有则增加
[php]<value name="catch_workers_output">yes</value>
<value name="error_log">/var/logs/php-fpm.log</value>[/php]
2.修改php.ini中配置,没有则增加
[php]log_errors = On
error_log = "/var/logs/php_errors.log"
error_reporting=E_ALL & ~E_NOTICE[/php]
阅读全文
storyboard is not availabel when compiling for targets before iOS6.0
storyboard is not availabel when compiling for targets before iOS6.0
如果想要编译最低版本4.3、5.0,那么完全自定义xib或者删除(准确的讲是取消)storyboard-base
ios5.0, ios6.0, storyboard阅读全文
Undefined symbols for architecture i386 _htmlReadFile referenced from
Undefined symbols for architecture i386 _htmlReadFile referenced from
解决办法是:添加 libxml.dylib
_htmlReadFile, libxml.dylib, Undefined symbols阅读全文
Undefined symbols for architecture i386 _deflate referenced from
Undefined symbols for architecture i386 _deflate referenced from
解决办法是:添加 libz.dylib
_deflate, libz.dylib, Undefined symbols阅读全文
wget网站采集
在linux下用wget命令做网站采集的命令是:
[php]wget -m -e robots=off -U "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6" "http://www.opensoce.com/"[/php]
wget命令 参数注释:
[php]"-e robots=off" 让wget无视robots.txt协议
-U "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6" ... wget, 网站采集阅读全文
IBAction和IBOutlet
These two keywords do absolutely nothing as far as the compiler is concerned. IBOutlet gets entirely removed from the code before the compiler ever sees it. IBAction resolves to a void return type, which just means that action methods do not return a value. So, what’s going on here?
The answer is simple, really: IBOutlet and IBAction are not used by the compiler. They are used by Interface Buil... IBAction, IBOutlet阅读全文
WordPress2+:Nonces
WordPress 2+: Nonces
WordPress 2.0.3+ has some security enhancements that a lot of people are wondering about, so here’s my attempt at explaining them.
Authentication: cookies are your backstage pass
When you sign into WordPress, you are granted a cookie… a little file that lives in your browser and acts as your “backstage pass” to the WordPress admin. This prevents unauthorized people from a... nonce阅读全文
rand不再需要srand给随机数播种
自 PHP 4.2.0 起,不再需要用 srand() 或 mt_srand() 函数给随机数发生器播种,现在已自动完成。
阅读全文
修复qTranslate卸载后的文章标题和内容
修复qTranslate卸载后的文章标题和内容
[php]< ?php
require_once('wp-config.php');
$link = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db (DB_NAME, $link);
$str = "SELECT ID,post_title,post_content FROM wp_posts where post_status='publish' order by ID desc limit 40";//
$ra = mysql_query($str);
while($r = mysql_fetch_array($ra)){
$r['post_title'] = preg_replace('|.*< \!--:-->|','',... 修复qTranslate, 卸载qTranslate阅读全文
WordPress插件后加载及延迟加载
wordpress插件加载顺序有时需要进行干预,因为有的函数会比较霸道,做了很多add_action会改变系统本身的一些变量,导致返回不正确,例如qTranslate会导致插件中获取语言包失败。分析wp-include/plugin.php的最后几行:
[php]
$ii=0;
do {
foreach( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) ){
$args[1] = $value;
$value = call_user_func_array($the_['function'], arra... qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage, qTranslate, Wordpress插件, 插件后加载, 插件延迟加载阅读全文