Skip to content

Instantly share code, notes, and snippets.

View Ray-Eldath's full-sized avatar

Ray Eldath Ray-Eldath

View GitHub Profile
@Ray-Eldath
Ray-Eldath / pinpointer.py
Created December 29, 2023 07:15
Filter out GitHub Runs that contains certain log line
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
@Ray-Eldath
Ray-Eldath / obcSpider.py
Last active December 29, 2023 07:14
HoYoLAB Observatory Center Spider (moved to https://github.com/Ray-Eldath/obcSpider)
# 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"), '角色'),
@Ray-Eldath
Ray-Eldath / leetcode.js
Created August 20, 2022 15:13
Leetcode Helper: 力扣刷题常用辅助功能
// 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
@Ray-Eldath
Ray-Eldath / main.py
Last active December 29, 2022 17:33
List your programming languages
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",
@Ray-Eldath
Ray-Eldath / main.py
Created June 3, 2021 16:04
netease-music likes exporter
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
@Ray-Eldath
Ray-Eldath / main.py
Created August 28, 2020 10:28
AutoPOJ
import base64
import click
import requests
from lxml import etree
def noi(uri):
return 'http://noi.openjudge.cn/' + uri
@Ray-Eldath
Ray-Eldath / Microsoft.PowerShell_profile.ps1
Last active December 29, 2022 15:49
Useful Powershell profile
#
# 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.
@Ray-Eldath
Ray-Eldath / style.css
Last active July 25, 2018 09:39
CSS use to render CmdMarkdown-like page
.comment {
background: #fff;
color: var(--comment-color);
padding-left: 4px;
padding-right: 4px;
border-radius: 4px;
}
.copyright .info {
font-size: 10px;