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
StableTimeSec = 5.1 | |
function INFO(s) | |
write(s .. "\n") | |
end | |
function WAIT() | |
sleep(StableTimeSec) | |
end |
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
#include <iostream> | |
#include <filesystem> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
namespace fs = std::filesystem; | |
void chown_with_offset(const fs::path &target_path, long offset, bool symbolic = false) | |
{ |
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
// need piority: document-start | |
function waitForElm(selector_list) { | |
let result_list = new Array(selector_list.length).fill(null) | |
// request all elements in selector, if all elements are set, then return true. | |
function collect_selection() { | |
selector_list.forEach((value, index) => { | |
if (!result_list[index]) { | |
let search_result = document.querySelector(value); | |
if (search_result) result_list[index] = search_result |
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
window.isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); | |
var isIOS = -1 < navigator.userAgent.search(/iphone/gi), | |
isAndroid = -1 < navigator.userAgent.search(/(android|linux)/gi); | |
function ywglvbaj(window, document, navigator, ac) { | |
;; | |
window._N1_ZS = function() { | |
function n(e) { | |
for (var o, n, t, r = {}, c = "", i = [], a = 0, f = 0, l = 32, u = -1, s = String.fromCharCode; l++ < 126;) 39 != l && 92 != l && (r[s(l)] = f++); | |
for ("number" == typeof e && (e = h[e]), f = l = 0; l++ < e.length;) |
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
'use strict'; | |
// ==UserScript== | |
// @name BiliBili截图工具 | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description 完全本地化的、在对bilibili视频进行截图的工具。 | |
// @author Neboer | |
// @match https://www.bilibili.com/video/* | |
// @icon https://www.bilibili.com/favicon.ico | |
// @grant none |
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
import simplematrixbotlib as botlib | |
from nio import RoomMemberEvent, rooms | |
from yaml import safe_load | |
from re import match | |
with open("config.yaml", "r", encoding="utf8") as config_file: | |
config = safe_load(config_file) | |
creds = botlib.Creds(config["target_server"], config["bot_username"], access_token=config["access_token"], session_stored_file=config["session_file"]) | |
bot = botlib.Bot(creds) |
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
import argparse | |
from pathlib import Path | |
import os | |
from os import scandir | |
from sys import stderr, exit | |
class PseudoDirEntry: | |
def __init__(self, path): | |
if not Path(path).exists(): | |
raise FileNotFoundError |
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
// gameinfo | |
// n, target, capacity, result | |
function perform(state, src, dst, info) { | |
state[dst] += state[src] | |
if (state[dst] > info.capacity[dst]) { | |
state[src] = state[dst] - info.capacity[dst] | |
state[dst] = info.capacity[dst] | |
} else { | |
state[src] = 0 | |
} |
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
#include "lodepng.h" | |
#include <math.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define max_buffer 0xFFFFFF | |
struct size | |
{ | |
unsigned width; |
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
dff |