Skip to content

Instantly share code, notes, and snippets.

🎯
在考GT

Guo Zeyu ZE3kr

🎯
在考GT
Block or report user

Report or block ZE3kr

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
@ZE3kr
ZE3kr / IP Service for Cloudflare Worker.js
Last active Feb 10, 2018
Demo: https://api.tloxygen.com/ip (Use Cloudflare by default, UPYUN for China) or http://api.tloxygen.net/ip (Only use Cloudflare)
View IP Service for Cloudflare Worker.js
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
async function fetchAndApply(request) {
if(request.url === 'https://api.tloxygen.com/ip' || request.url === 'http://api.tloxygen.com/ip') {
const ip = request.headers.get('cf-connecting-ip')
return new Response(ip)
} else if (request.url === 'https://api.tloxygen.com/country' || request.url === 'http://api.tloxygen.com/country') {
const ip = request.headers.get('cf-ipcountry')
@ZE3kr
ZE3kr / ddns.sh
Created Feb 25, 2017
DDNS.sh for Rage4, Hurricane Electric DNS and Hurricane Electric Tunnel Broker
View ddns.sh
#!/bin/sh
# A simple DDNS tool written in shell, support Rage4, Hurricane Electric DNS and Hurricane Electric Tunnel Broker.
# @version 0.1.2
# Global Settings, set to ture to enable
use_ipv4=false;
use_ipv6=false;
logfile="/var/log/ddns.log"; # Set it to "/dev/null" to disable log.
get_ip_service="http://api.tlo.xyz:8081/myip/ip.php"; # Need to support IPv4 and IPv6
@ZE3kr
ZE3kr / theme.js
Last active Nov 13, 2016 — forked from jessor/theme.js
Track Wordpress Comments as Piwik Goals with jQuery
View theme.js
jQuery.noConflict();
jQuery(document).ready(function($) {
// ...
$('#commentform').submit(function() {
_paq.push(['trackGoal', '1']); // logs a conversion for goal 1
});
// ...
});
@ZE3kr
ZE3kr / README.md
Last active Sep 3, 2016
WoSign GitHub.io
View README.md
@ZE3kr
ZE3kr / en.php
Last active Jan 29, 2017
Add Reply Notify via Email on WordPress, no configuration is needed. 中文介绍:https://ze3kr.com/2016/08/back-to-wordpress-builtin-comment-system/
View en.php
<?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 Jun 30, 2017
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.".
View wordpress-super-cache.conf
# 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 Aug 29, 2015
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)
View index.php
<?
$mmc = memcache_init();
/**
* 将分数转化为浮点数
**/
function Deci_Con($coordPart){
$parts = explode('/', $coordPart);// 将 "/" 的两边数据转化为数组
if (count($parts) <= 0)
You can’t perform that action at this time.