Skip to content

Instantly share code, notes, and snippets.

View hifocus's full-sized avatar
💔
emo 中

hifocus

💔
emo 中
View GitHub Profile
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="applicable-device" content="pc,mobile">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>正在前往QQ</title>
@hifocus
hifocus / Links
Created April 1, 2018 07:51
Jay_Chou
function comment_mail_notify($comment_id){
$mail_user_name = akina_option('mail_user_name') ? akina_option('mail_user_name') : 'poi';
$comment = get_comment($comment_id);
$parent_id = $comment->comment_parent ? $comment->comment_parent : '';
$spam_confirmed = $comment->comment_approved;
if(($parent_id != '') && ($spam_confirmed != 'spam')){
$wp_email = $mail_user_name . '@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
$to = trim(get_comment($parent_id)->comment_author_email);
$subject = '你在 [' . get_option("blogname") . '] 的留言有了回应';
$message = '
@hifocus
hifocus / gist:38fc28687246a63a3d7dfde57d1d9d0a
Created April 16, 2018 04:14
here is a sample of the traffic that was filtered.
Hi,
here is a sample of the traffic that was filtered.
2018-04-15 15:16:25 UTC IP 158.140.165.210:123 > 45.77.183.156:53276 UDP, length 1835036, packets 4096
2018-04-15 15:16:25 UTC IP 158.140.185.231:123 > 45.77.183.156:53276 UDP, length 1835036, packets 4096
2018-04-15 15:16:25 UTC IP 221.176.192.37:123 > 45.77.183.156:12762 UDP, length 1835036, packets 4096
2018-04-15 15:16:25 UTC IP 42.119.241.7:123 > 45.77.183.156:53276 UDP, length 1835036, packets 4096
2018-04-15 15:16:25 UTC IP 42.118.76.189:123 > 45.77.183.156:53276 UDP, length 1835036, packets 4096
2018-04-15 15:16:25 UTC IP 218.203.88.22:123 > 45.77.183.156:53276 UDP, length 360476, packets 4096
@hifocus
hifocus / Single CDN
Created May 4, 2018 10:12
Enable CDN for Typecho Theme Single - Just replace this with header.php
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php $this->archiveTitle(array(
'category' => _t('%s'),
'search' => _t('含关键词 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
@hifocus
hifocus / gist:905346ed7923ec0c1c3059c6ce1e9dc1
Created May 31, 2018 03:04
Material\inc\preview-images\prevdem-functions.php
<?php
/**
* Get a random image from demo content
* Can be recursive if a specific img size is not found
*
* @param int $i Maximum number of recalls.
*
* @return mixed
*/
function material_get_prevdem_img_src( $i = 0 ) {
@hifocus
hifocus / index.html
Created July 7, 2018 09:38
CFMobile
<!DOCTYPE html>
<html>
<head>
<meta name="robots" content="all" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Copyright" content="Copyright (c) 2006-2013 TENCENT" />
<meta name="Description" content="游戏下载" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
@hifocus
hifocus / release.html
Last active July 7, 2018 17:25
Get Github Release
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.loli.net/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function () {
jQuery.getJSON("https://api.github.com/repos/idawnlight/typecho-theme-material/tags").done(function (data) {
jQuery('#release-download').attr('href', data[0].zipball_url);
})
<!DOCTYPE HTML>
<!--
Story by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>维棠插件下载站</title>
@hifocus
hifocus / non-sense.php
Created October 21, 2018 01:18
non-sense.php
<?php
static $valid_hosts = ["aaa.com", "bbb.com", "ac.ccc.com", "localhost"];
static $jump_uri = "https://example.com";
if (!in_array(parse_url($_SERVER['HTTP_REFERER'], \PHP_URL_HOST), $valid_hosts)) {
header("location: $jump_uri");
die();
}
$addresses = [