Skip to content

Instantly share code, notes, and snippets.

@heywin
heywin / DomainFilter.php
Created January 11, 2015 14:53
域名长度筛选
<?php
$content = file_get_contents("list.txt");
//echo $content;
$array = explode("\n", $content);
// print_r($array);
// foreach($array as $a){
// if (strlen($a) < 16 && strlen($a) > 14)
// echo $a."<br>";
@heywin
heywin / wordpress-default.css
Created January 22, 2015 05:10
Default WordPress classes for using with CSS
/**
* Default Body Class Styles
*/
.rtl {}
.home {}
.blog {}
.archive {}
.date {}
.search {}

Theme Testing Process

from Theme Development (Wordpress Codex)

  • Fix PHP and WordPress errors. Add the following debug setting to your wp-config.php file to see deprecated function calls and other WordPress-related errors: define('WP_DEBUG', true);. See Deprecated Functions Hook for more information.
  • Check template files against Template File Checklist.
  • Do a run-through using the Theme Unit Test.
  • Validate HTML and CSS. See Validating a Website.
  • Check for JavaScript errors.
  • Test in all your target browsers. For example, IE7, IE8, IE9, Safari, Chrome, Opera, and Firefox.
  • Clean up any extraneous comments, debug settings, or TODO items.
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@heywin
heywin / readme.txt
Created October 9, 2015 07:19 — forked from fqrouter/readme.txt
shadowsocks 公共代理的必要设置
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
@heywin
heywin / wxtest.php
Created November 20, 2015 04:20
微信Token验证失败测试代码
<?php
define("TOKEN", "weixin");
traceHttp();
$wechatObj = new wechatCallbackapiTest();
$wechatObj -> valid();
class wechatCallbackapiTest
{
public function valid()
@heywin
heywin / p.php
Created November 20, 2015 04:21
雅黑PHP探针
<?php
/* ----------------本探针基于YaHei.net探针------------------- */
error_reporting(0); //抑制所有错误信息
@header("content-Type: text/html; charset=utf-8"); //语言强制
ob_start();
$title = "雅黑PHP探针";
$version = "v0.4.2"; //版本号
define('HTTP_HOST', preg_replace('~^www\.~i', '', $_SERVER['HTTP_HOST']));
# 规则配置仅供参考,适用于Surge iOS 1.2.3 (543) 及其后续版本;
# 包含 Proxy Group、URL Rewrite 特性;
# 包含 Reject 规则,用于拦截广告、行为分析、数据统计;
# 屏蔽 Hao123、百度联盟广告以及部分运营商网页漂浮广告;
# Surge 新手使用指南 http://bit.ly/1q5eTlF
[General]
# warning, notify, info, verbose
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0/96
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
loglevel = notify
@heywin
heywin / chromedriver.md
Last active February 12, 2017 12:01
MacOS下selenium和chromedriver配置