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 asyncio | |
import json | |
import os | |
import aiohttp | |
from gidgethub import aiohttp as gh_aiohttp | |
Token = os.getenv("PINPOINTER_GITHUB_TOKEN") | |
Repo = "cloudberrydb/cloudberrydb" | |
MaxRuns = 100000 # unlimited |
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
# this has been moved to https://github.com/Ray-Eldath/obcSpider | |
import requests | |
from lxml import etree | |
Configurations = { | |
'genshin_impact': { | |
'home_url': 'https://api-static.mihoyo.com/common/blackboard/ys_obc/v1/home/content/list?app_sn=ys_obc&channel_id=189', | |
'detail_url': 'https://api-static.mihoyo.com/common/blackboard/ys_obc/v1/content/info?app_sn=ys_obc&content_id={}', | |
'language_tabs': ['汉语', '日语', '韩语', '英语'], | |
'character_fn': lambda home: select(select(home, "图鉴", "children"), '角色'), |
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
// ltarreq 用于判断两组数组字符串是否相等。返回每组的判等情况。 | |
// 力扣中有许多「不限返回顺序」的题目(如 #401 二进制手表、#77 组合、#47 全排列,等等), | |
// 若你的答案的顺序和预期结果的顺序不一致,一行行、一项项比较会非常累人。 | |
// 这时,将整个多行的「输出」和多行的「预期结果」用反引号(`)包住传入该方法,即可自动比较它们的相等性。 | |
// | |
// TODO: 等我闲下来会将这个功能做成油猴脚本 / 浏览器插件,如果我在刷题中还发现了什么需要的功能会继续更新本 gist。 | |
function ltarreq(a, b) { | |
as = a.split("\n") | |
bs = b.split("\n") | |
if (as.length != bs.length) return false |
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
from pprint import pprint | |
from gql import Client, gql | |
from gql.transport.aiohttp import AIOHTTPTransport | |
personal_api_token = 'YOUR PERSONAL TOKEN' | |
username = 'YOUR USERNAME' | |
def main(): | |
transport = AIOHTTPTransport(url="https://api.github.com/graphql", |
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 requests, json | |
def main(): | |
r = requests.get('http://127.0.0.1:3000/likelist', params={'uid': 330793262, # your uid | |
'cookie': 'your cookie'}) | |
r = json.loads(r.text)['ids'] | |
total = len(r) | |
processed = 0 |
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 base64 | |
import click | |
import requests | |
from lxml import etree | |
def noi(uri): | |
return 'http://noi.openjudge.cn/' + uri | |
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
# | |
# The top three lines are for my oh-my-posh and Terminus. Comment them out if you don't need. | |
# | |
# Actions defined: | |
# - ls: shorten ls. | |
# - open: locate to that directory if provided a directory, open the files if provide | |
# files. the file whose extension is specified in $global:openByNPP will opened | |
# by Notepad++ or any other program you set. | |
# - cd1, cd2: memorize the current path and change to this path at the next innovation. | |
# - sizeof: show the size of a file. |
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
.comment { | |
background: #fff; | |
color: var(--comment-color); | |
padding-left: 4px; | |
padding-right: 4px; | |
border-radius: 4px; | |
} | |
.copyright .info { | |
font-size: 10px; |