This file contains hidden or 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
MAX_HEADING_DISTANCE_DEFAULT = 200 | |
GOOD_OR_BAD = {'good', 'bad'} | |
GOOD_BAD_NEARGOOD = {'good', 'bad', 'neargood'} | |
def _get_neighbour(i, paragraphs, ignore_neargood, inc, boundary): | |
while i + inc != boundary: | |
i += inc | |
c = paragraphs[i].class_type | |
if c in GOOD_OR_BAD: | |
return c |
This file contains hidden or 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
#![allow(unused)] | |
//! 并查集:解决节点连接/关联问题 | |
use std::fs::File; | |
use std::io::{self, Read, Write}; | |
use std::path::Path; | |
use std::slice; | |
fn load_vector<T>(path: &Path) -> io::Result<Vec<T>> | |
where |
This file contains hidden or 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
const Parser = require('rss-parser'); | |
const translate = require('translation-google'); | |
module.exports = async (ctx) => { | |
const parser = new Parser(); | |
const baseUrl = 'https://export.arxiv.org/rss/cs'; | |
const feed = await parser.parseURL(baseUrl); | |
const tempItem = []; | |
feed.items.length = 100; |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
""" | |
Outputs some information on CUDA-enabled devices on your computer, | |
including current memory usage. | |
It's a port of https://gist.github.com/f0k/0d6431e3faa60bffc788f8b4daa029b1 | |
from C to Python with ctypes, so it can run without compiling anything. Note | |
that this is a direct translation with no attempt to make the code Pythonic. |
This file contains hidden or 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
from lxml import etree | |
import requests | |
import html2text | |
from bs4 import BeautifulSoup | |
import codecs | |
def request_get(url): | |
session = requests.Session() | |
headers = { | |
'User-Agent': 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36'} |
This file contains hidden or 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
#EXTINF:-1 tvg-logo="https://upload.wikimedia.org/wikipedia/commons/thumb/7/78/NHK_General_TV_logo.svg/1920px-NHK_General_TV_logo.svg.png" group-title="Japan",NHK G | |
http://203.162.235.41:16903 | |
#EXTINF:-1 tvg-logo="https://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/NHK_Educational_TV_logo.svg/1200px-NHK_Educational_TV_logo.svg.png" group-title="Japan",NHK ETV | |
http://203.162.235.41:16901 | |
#EXTINF:-1 tvg-logo="https://upload.wikimedia.org/wikipedia/commons/6/6d/NHKBS1%E3%83%AD%E3%82%B42020-.png" group-title="Japan", NHK BS 1 | |
http://203.162.235.41:16909 | |
#EXTINF:-1 tvg-logo="https://vignette.wikia.nocookie.net/logopedia/images/8/87/Q1_%281%29.jpg" group-title="Japan", NHK BS Premium | |
http://203.162.235.41:16910 | |
#EXTINF:-1 tvg-logo="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Mainichi_Broadcasting_System_logo.svg/1200px-Mainichi_Broadcasting_System_logo.svg.png" group-title="Japan",MBS | |
http://203.162.235.41:16907 |
This file contains hidden or 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
name: 重定向 | |
desc: 常用HTTPS重定向 | |
http: | |
mitm: | |
- g.cn | |
- "*.google.cn" | |
- "api.abema.io" | |
- "www.firefox.com.cn" | |
- "*.mox.moe" |
This file contains hidden or 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 bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS | |
# Can retrieve cloudflare Domain id and list zone's, because, lazy | |
# Place at: | |
# curl https://raw.githubusercontent.com/yulewang/cloudflare-api-v4-ddns/master/cf-v4-ddns.sh > /usr/local/bin/cf-ddns.sh && chmod +x /usr/local/bin/cf-ddns.sh |
This file contains hidden or 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
# Source: https://github.com/LaMP57/BilibiliMangaDownload | |
# 支持从连续使用多个账号的网页版 SESSDATA,或者使用单个手机抓包得到的 Token,自动购买/解锁章节,验证下载图片完整性连续下载一本漫画的所有章节的功能。 | |
import json | |
import os | |
import re | |
import requests | |
import zipfile | |
from io import BytesIO | |
from PIL import Image |
This file contains hidden or 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
Rust 6 hrs 11 mins ██████▉░░░░░░░░░░░░░░ 32.9% | |
Python 5 hrs 36 mins ██████▎░░░░░░░░░░░░░░ 29.9% | |
Other 2 hrs 19 mins ██▌░░░░░░░░░░░░░░░░░░ 12.3% | |
Bash 1 hr 3 mins █▏░░░░░░░░░░░░░░░░░░░ 5.6% | |
Markdown 54 mins █░░░░░░░░░░░░░░░░░░░░ 4.8% |