left emtpy
View nlc-getbook.js
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
async function downloadBook(aid, bid) { | |
const [title, myreader, kime, fime] = await getBookKey(aid, bid) | |
const r = await fetch(`http://read.nlc.cn/menhu/OutOpenBook/getReader?aid=${aid}&bid=${bid}&kime=${kime}&fime=${fime}`, { method: "POST", headers: { myreader: myreader }}) | |
const d = await r.arrayBuffer() | |
saveByteArray(title + ".pdf", d) | |
} | |
async function getBookKey(aid, bid) { | |
const r = await fetch(`http://read.nlc.cn/OutOpenBook/OpenObjectBook?aid=${aid}&bid=${bid}`) |
View cipher.java
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 com.coloros.mcssdk.c.a; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
//import org.json.JSONObject; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
System.out.println("Hello world!"); | |
String key1 = key.substring(16, 32); |
View leetcode-contest-cheating-filter.js
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
async function run() { | |
const contest = 169; | |
const pages = [...Array(25).keys()].map(v => v + 1); | |
const question_id = 1429; | |
const is_cheating = function(code) { | |
const words = [/*"MONEY", "POINT",*/ "HOPE", "SATURN", "SEIS", "GEMINI", "ELM", "YOUVE", "PLANETS", "PEOPLE", "EHGEEE", "CANCER", "FBCDE", "TWENTY", "TREES", "EUROPE", "ABCDE", "NOVENTA", "EAII", "FUNNY", "ADICG", "FALSE", "TRUE", "EEIE", "THREE", "DHCF", "DHBADI", "INDEED"]; | |
let score = 0; | |
for (const word of words) { | |
if (code.indexOf(word) != -1) { | |
score += 1; |
View cfapi-ddns-worker.js
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
// CloudFlare API token | |
// for zone: example.com (Edit) | |
const CLOUDFLARE_API_TOKEN = "TO_BE_FILLED"; | |
// Currently, there seems not to be a way to get zone ids with tokens. So hardcode it here. | |
// https://community.cloudflare.com/t/bug-in-list-zones-endpoint-when-using-api-token/115048 | |
// Trailing dots CANNOT BE OMITTED. | |
const ZONES = { | |
"example.org.": { | |
id: "TO_BE_FILLED" | |
}, |
View proxy_checker.py
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 python3 | |
import asyncio | |
import aiohttp | |
import re | |
import sys | |
import time | |
from collections import namedtuple | |
from functools import wraps | |
View WSExport-zh.js
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
// WSExport [[mul:Wikisource:WSexport]] | |
// > WSexport is a tool for exporting Wikisource's texts in EPUB, PDF and other file formats. It was created by user Tpt for French Wikisource, but it's also available for the other Wikisource subdomains. | |
// Copied from https://en.wikisource.org/w/load.php?lang=en&modules=ext.gadget.Easy_LST%2CPurgeTab%2CWSexport%2Ccharinsert%2CcollapsibleTables%2CdynamicLayoutOverrides&skin=vector&version=01fx33l | |
// and modified slightly to adapt to Chinese WikiSource by Gowee@Github. | |
if ($.inArray(mw.config.get('wgNamespaceNumber'), [0, 114]) !== -1) { | |
$(function() { | |
mw.util.addPortletLink('p-electronpdfservice-sidebar-portlet-heading', '//tools.wmflabs.org/wsexport/tool/book.php?' + $.param({ | |
lang: 'zh', | |
format: 'epub-3', | |
page: mw.config.get('wgPageName') |
View cnmooc.py
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 python3 | |
from time import sleep | |
from collections import namedtuple | |
import json, re, os, csv | |
from urllib.parse import parse_qsl, urljoin, urlparse, urlencode | |
from requests import Session | |
from requests.cookies import create_cookie | |
parse_qs = lambda *args, **kwargs: dict(parse_qsl(*args, **kwargs)) | |
Info = namedtuple("CourseInfo", ["name", "teacher"]) |
View relayd.patch
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
3a4,5 | |
> . $IPKG_INSTROOT/lib/functions/network.sh | |
> | |
45a48 | |
> local dhcp_ipaddr | |
47a51,64 | |
> config_get proto "$net" proto | |
> [ "$proto" = "dhcp" ] && { | |
> local addrs | |
> network_get_ipaddr addrs "$net" |
View telegram_reborn.py
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 python3 | |
import sys | |
import json | |
from functools import partial | |
from pyrogram import Client, Error | |
from pyrogram.client.types.user_and_chats.dialog import Dialog | |
from pyrogram.client.types.user_and_chats.chat import Chat | |
from pyrogram.api.functions.channels import InviteToChannel | |
eprint = partial(print, file=sys.stderr) |