This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
public class MazeSolver { | |
static final int ROW = 5; | |
static final int COL = 5; | |
static final int startX = 0; | |
static final int startY = 0; | |
static final int endX = 4; | |
static final int endY = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 轮询剪贴板的频率 | |
local frequency = 2 | |
-- 剪贴板历史记录条数 | |
local history_size = 10 | |
-- 显示在菜单栏中的字符长度 | |
local label_length = 50 | |
-- 还原剪贴板历史记录 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$cache = '/tmp/_lighthouse_traffic_'; | |
$cacheTime = 3600; | |
$now = time(); | |
if (is_file($cache) && is_readable($cache)) { | |
$content = file_get_contents($cache); | |
$_time = substr($content, 0, 10); | |
$content = substr($content, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CaesarEncode 凯撒密码:加密 | |
func CaesarEncode(str string, step rune) string { | |
step = step % 26 | |
strSlice := []rune(str) | |
dstSlice := strSlice | |
for i := 0; i < len(strSlice); i++ { | |
if !unicode.IsLetter(strSlice[i]) { | |
strSlice[i] = strSlice[i] | |
continue | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
prefix="192.168.50" | |
cd /etc/pve/nodes/pve/lxc | |
for conf in `ls`;do | |
id=$(echo $conf|awk -F '.' '{print $1}') | |
name=$(cat $conf|grep hostname|awk '{print $2}') | |
mac=$(cat $conf|grep 'net0:'|awk -F '[=,]' '{print $8}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 引入类库 | |
local redis = require "resty.redis".new() | |
local mysql = require "resty.mysql".new() | |
local cjson = require "cjson" | |
-- 获取参数 | |
local param_get = ngx.req.get_uri_args() | |
local id = param_get["id"] | |
-- 连接 Redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 解析内容源代码中的 Github Gist 链接 | |
* | |
* @package Github Gist | |
* @version 0.0.1 | |
* @author Simple Code | |
* @link http://typecho.org | |
*/ | |
class GithubGist implements Typecho_Plugin_Interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
listen 443; | |
listen [::]:443; | |
server_name fonts.fengqi.me font.fengqi.me; | |
root /data/www/fonts.fengqi.me.SF92s/; | |
index index.php; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int num = 0; | |
cin >> num; | |
double delta = 1e-5; // ?? | |
for (int i =0 ; i < num; i++) { |