Skip to content

Instantly share code, notes, and snippets.

View spacemeowx2's full-sized avatar

imspace spacemeowx2

  • 16:41 (UTC +08:00)
View GitHub Profile
@spacemeowx2
spacemeowx2 / build_lan_play_termux.sh
Last active October 15, 2020 23:08
build switch lan play on termux
pkg install -y cmake make clang libpcap-dev git
git clone https://github.com/spacemeowx2/switch-lan-play.git
mkdir switch-lan-play/build
pushd switch-lan-play/build
cmake ..
make
popd
cp ./switch-lan-play/build/src/lan-play .
@spacemeowx2
spacemeowx2 / import.py
Created October 9, 2018 06:51
ida python
from idaapi import *
from idc import *
from idautils import *
@spacemeowx2
spacemeowx2 / slp_servers.json
Last active October 10, 2018 09:20
server list example for switch-lan-play
{
"update_time": 153916320,
"list": [{
"name": "服务器1",
"address": "0.0.0.0:1234",
"description": "服务器描述, 比如服务器官网之类的"
}]
}
@spacemeowx2
spacemeowx2 / slp_udpping.js
Created December 13, 2018 12:18
slp_udpping.js
const dgram = require('dgram')
const crypto = require('crypto')
function udpPing (server, port = 11451, timeout = 1000) {
return new Promise((resolve, reject) => {
const socket = dgram.createSocket('udp4')
const myReject = (err) => {
socket.close()
reject(err)
}
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
// ==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==
#!/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])
@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 {
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 / 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