简介

高亮方案

本主题没有使用自定义高亮方式,高亮方案在Hexo本身支持的highlightjsprismjs基础上修改得到

使用highlightjs

highlight:
  enable: true
  line_number: false
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: true
prismjs:
  enable: false
  ...

highlightprismjsenable: true只能保留一个

在站点配置文件将highlight设置enable: true即可开启 line_number选项本主题暂不支持显示

若需要支持代码高亮可设置hljs: true 该配色方案参考了tomorrow night等配色主题

其他具体参数设置可参考Hexo相关文档

使用prismjs

prismjs中设置enable: truepreprocess: true即可开启 默认支持Line NumbersShow Languages两个插件 如果需要其他插件支持可以设置preprocess: false

当前主题版本不支持preprocess: false自动引入相关文件 如有相关需求请自行引入相关css与js文件

设置line_number: true即可显示行号

演示

以下演示采用prismhighlight在主题效果可参见(TODO)

有八种高亮主题可选择

Javascript

const smoothScrollToTop = () => {
  let yTopValve = (window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop);
  if (yTopValve > 1) {
    window.requestAnimationFrame(smoothScrollToTop);
    scrollTo(0, Math.floor(yTopValve * 0.85));
  } else {
    scrollTo(0, 0);
  }
};

setTimeout(() => {
  document.getElementById('scrollbutton').onclick = smoothScrollToTop;
}, 0);

C++

#include<cstdio>
#include<iostream>
#include<algorithm>
const int maxn=1050;
const int maxm=20000010;
int h,n,v[maxn],w[maxn],f[maxm],maxx;
int main()
{
	cin>>h>>n;
	memset(f,0x3f,sizeof(f));
	f[0]=0;
	for(int i=1;i<=n;i++) cin>>v[i]>>w[i],maxx=max(v[i],maxx);
	for(int i=1;i<=n;i++)
	{
		for(int j=v[i];j<=h+maxx;j++)
			f[j]=min(f[j],f[j-v[i]]+w[i]);	
	}
	int ans=inf;
	for(int i=h;i<=h+maxx;i++) ans=min(ans,f[i]);
	cout<<ans<<endl;
	return 0;
}

PHP

<?php
error_reporting(0);
if(!isset($_GET['num'])){
    show_source(__FILE__);
}else{
        $str = $_GET['num'];
        $blacklist = [' ', '\t', '\r', '\n','\'', '"', '`', '\[', '\]','\$','\\','\^'];
        foreach ($blacklist as $blackitem) {
                if (preg_match('/' . $blackitem . '/m', $str)) {
                        die("what are you want to do?");
                }
        }
        eval('echo '.$str.';');
}
?>

JSON

{
  "name": "hexo-theme-kaze",
  "description": "hexo-theme-kaze",
  "author": "theme-kaze",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/theme-kaze/hexo-theme-Kaze/issues"
  },
  "homepage": "https://github.com/theme-kaze/hexo-theme-Kaze#readme"
}

Python

import requests
import re
import sys
import os
url = 'https://twoshot.hgame.n3ko.co/'
headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
}
p = requests.get(url+'random.php?times=228', headers=headers)
randnum = re.findall(r'\d*', p.text)[1:-2:2]
firstnum = randnum[0]
lastnum = randnum[227]
content = os.popen("python3 ./reverse_mt_rand.py " +
                   firstnum+' '+lastnum+' 0 0').read()
q = requests.post(url+'/verify.php', headers=headers, data={'ans': content})
print(q.text)

Go

// backup my secret key into DB
_, err = db.Exec(fmt.Sprintf(`INSERT INTO secret(secret) VALUES('%s');`, secretKey))
if err != nil {
    return err
}

if u.TotalBalance > 999999 || win {
    flag = os.Getenv("flag")
} else {
    flag = "nothing to show, to be a winner"
}