Skip to content

Instantly share code, notes, and snippets.

View ZE3kr's full-sized avatar
🎯
Focusing

James Guo ZE3kr

🎯
Focusing
View GitHub Profile
@ZE3kr
ZE3kr / en.php
Last active January 29, 2017 10:58
Add Reply Notify via Email on WordPress, no configuration is needed. 中文介绍:https://ze3kr.com/2016/08/back-to-wordpress-builtin-comment-system/
<?php
function tlo_comment_mail_notify($comment_id) {
global $comment_author;
$comment = get_comment($comment_id);
$parent_id = $comment->comment_parent ? $comment->comment_parent : '';
$spam_confirmed = $comment->comment_approved;
$from = $comment->comment_author_email;
$to = get_comment($parent_id)->comment_author_email;
if (($parent_id != '') && ($spam_confirmed != 'spam') && $from != $to && $to != get_bloginfo('admin_email') ) {
$blog_name = get_option('blogname');
@ZE3kr
ZE3kr / wordpress-super-cache.conf
Last active June 30, 2017 09:07
Can be used for WP Super Cache plugin. You need to configure WP Super Cache to "Use PHP to serve cache files.", and turned ON "Don’t cache pages with GET parameters.", turned OFF "Compress pages so they’re served more quickly to visitors.".
# WP Super Cache rules.
# Designed to be included from a 'wordpress-ms-...' configuration file.
set $cache_uri $uri;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $cache_uri 'null cache';
}
@ZE3kr
ZE3kr / index.php
Last active August 29, 2015 14:24
Read and formatting the EXIF data from UPYUN and generate a JavaScript code. Support GPS data and use Mapbox. (Used in https://ze3kr.tlo.xyz and can across domain)
<?
$mmc = memcache_init();
/**
* 将分数转化为浮点数
**/
function Deci_Con($coordPart){
$parts = explode('/', $coordPart);// 将 "/" 的两边数据转化为数组
if (count($parts) <= 0)