Skip to content

Instantly share code, notes, and snippets.

View spacemeowx2's full-sized avatar

imspace spacemeowx2

  • 11:35 (UTC +08:00)
View GitHub Profile
@spacemeowx2
spacemeowx2 / clean.ps1
Created October 26, 2021 17:31
Clear all UPnP devices
$upnppath = 'HKLM:\System\CurrentControlSet\Enum\SWD\DAFUPnPProvider'
$upnpdevices = Get-ChildItem $upnppath | Get-ItemProperty -name 'FriendlyName'
foreach ($upnpdevice in $upnpdevices) {
if ($upnpdevice.'FriendlyName' -ne 'I wont be deleted') {
$name = $upnpdevice.PSChildName
echo "Deleting $name"
pnputil /remove-device "SWD\DAFUPnPProvider\$name"
}
}
use protocol::*;
use deku::prelude::*;
use tokio::prelude::*;
use std::{io, collections::VecDeque};
const HEADER_LEN: usize = 1 + 4;
fn other<E: std::error::Error + Send + Sync + 'static>(err: E) -> io::Error {
io::Error::new(io::ErrorKind::Other, err)
}
@spacemeowx2
spacemeowx2 / ldn_frame.bt
Created November 11, 2020 11:21
ldn_frame.bt
//------------------------------------------------
//--- 010 Editor v9.0.2 Binary Template
//
// File: ldn_frame
// Authors: spacemeowx2
// Version: 0.1.0
// Purpose:
// Category:
// File Mask:
// ID Bytes:
// ==UserScript==
// @name 自动填分区
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 自动选b站开播分区
// @author You
// @match https://link.bilibili.com/p/center/index
// @grant none
// ==/UserScript==
@spacemeowx2
spacemeowx2 / readme.txt
Created April 19, 2020 05:55
A Plaid Puzzle (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
function gqlPing(server, delay = 0) {
return new Promise((res, rej) => {
const ws = new WebSocket(`ws://${server}`, 'graphql-ws')
let timeoutId = undefined
let lastTime = undefined;
const doPing = () => {
ws.send(`{"id":"1","type":"start","payload":{"variables":{},"extensions":{},"operationName":null,"query":"subscription{serverInfo{online}}"}}`)
lastTime = Date.now()
}
ws.onmessage = (e) => {
@spacemeowx2
spacemeowx2 / tg-hide-sidebar.css
Created September 10, 2019 11:48
tg-hide-sidebar
.im_dialog_peer {
opacity: 0.05;
}
.im_dialog {
padding: 7px 7px !important;
}
.im_dialog_message_wrap {
display: none;
}
.im_dialogs_col_wrap {
#!/usr/bin/env python3
import shbus.realtime
line = '733路'
direction = True
stop = 0
client = shbus.realtime.client()
response = client.getRealtimeBus(line, stop, direction=direction)
print(response.info.routes[0 if direction else 1].names[stop])
// ==UserScript==
// @name 显示B站弹幕发送时间
// @namespace http://imspace.cn/
// @version 0.1
// @description 显示B站弹幕发送时间
// @author Space
// @match https://live.bilibili.com/*
// @match http://live.bilibili.com/*
// @grant none
// ==/UserScript==
const groupCount = 5
function sim() {
let score = {}
for (let i = 0; i < groupCount; i++) {
score[i] = 0
}
for (let i = 0; i < groupCount - 1; i++) {
for (let j = i + 1; j < groupCount; j++) {
const win1 = Math.random() < 0.5