Skip to content

Instantly share code, notes, and snippets.

View WincerChan's full-sized avatar
🎯
Focusing

LoeRfy WincerChan

🎯
Focusing
View GitHub Profile
@WincerChan
WincerChan / export.py
Last active September 26, 2023 07:19
导出qq聊天记录的小脚本(需要{qq号}.db和IMEI码)
from hashlib import md5
from sqlite3 import connect as sql_conn
from time import localtime, strftime
class IllegalException(Exception):
def __init__(self, *args):
super().__init__(*args)
@WincerChan
WincerChan / aria2.conf
Created June 15, 2019 08:11
Aria2 配置文件
## 全局设置 ## ============================================================
# 日志
#log-level=warn
#log=/PATH/.aria2/aria2.log
# 下载位置,改成你自己的 默认: 当前启动位置
dir=/media/wincer/Deep/Videos
disk-cache=32M
# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc
@WincerChan
WincerChan / get_link.py
Last active October 22, 2021 05:53
获得QQ音乐直链
@WincerChan
WincerChan / main.rs
Created February 18, 2021 09:11
test for cangjie tokenstream
use tantivy::{SnippetGenerator, collector::TopDocs};
use tantivy::query::QueryParser;
use tantivy::schema::*;
use tantivy::{doc, Index, ReloadPolicy};
use cang_jie::{CangJieTokenizer, TokenizerOption, CANG_JIE};
use jieba_rs::Jieba;
use std::sync::Arc;
fn tokenizer() -> CangJieTokenizer {
Python 18 hrs 33 mins ████████████████▎░░░░ 77.5%
HTML 1 hr 40 mins █▍░░░░░░░░░░░░░░░░░░░ 7.0%
Other 1 hr 28 mins █▎░░░░░░░░░░░░░░░░░░░ 6.2%
JavaScript 52 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.7%
Bash 33 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.4%
@WincerChan
WincerChan / trie.go
Last active June 7, 2020 05:17
某些时候,字典树比哈希表更快吗?| Sometimes, is trie faster than hashmap?
package main
const R = 26
type TrieNode struct {
value int
next []TrieNode
}
type TrieST struct {
@WincerChan
WincerChan / hitokoto.js
Created July 20, 2017 14:28
js脚本模拟一言API
var rand1 = Math.floor(Math.random()*410);quotes = new Array
quotes[0]='若隐若现才是艺术! ——「问题儿童来自异世界」'
quotes[1]='下一次重逢,将是何年何月?天空必将见证。 ——「SOLA」'
quotes[2]='如果你都不知道自己想去哪里,那去哪里都是一样的。 ——「柴郡猫」'
quotes[3]='一定没有问题的! ——「魔卡少女樱」'
quotes[4]='这是眼泪吗?原来眼泪是这么的温暖,我一直以为,哀伤的东西都是冰冷的。 ——「风色幻想」'
quotes[5]='桑丘,让他们管我叫疯子吧,我还疯得不够,所以得不到他们的赞许。 ——「堂吉诃德」'
quotes[6]='美好的人眼裡映出的世界也是美好的。 ——「ARIA」'
quotes[7]='如果不能忠于自己的心,胜负又有什么价值呢? ——「塔希里亚故事集」'
quotes[8]='天空本是一种风景,可是遇见你之后,它变成了一种心情。 ——「九ちのセカィ」'
from os import listdir
def main():
for file in listdir("./"):
if file.endswith('.md'):
single(file)
def single(file):
@WincerChan
WincerChan / config.yml
Created June 14, 2018 12:18
CircleCI 配置文件
# 设置默认 image
defaults: &defaults
docker:
- image: circleci/node:10.4.0
version: 2
jobs:
build:
# 导入默认设置
<<: *defaults
@WincerChan
WincerChan / loadCORS.js
Created May 27, 2018 07:57
将跨域资源转为本地资源
// 脚本资源
let tmpWorker = await fetch(workerUrl),
workerSrcBlob = new Blob([await tmpWorker.text()], { type: 'text/javascript' }),
workerBlobURL = window.URL.createObjectURL(workerSrcBlob);
// workerBlobURL 即为网站域名下的资源
// 图片资源
let tmpImg = await fetch(imageUrl),