-
MemoryCardManager.cpp/ThreadedMemoryCardWorker::DoHeartbeat
-
MemoryCardDriver::DoOneUpdate
-
MemoryCardDriverThreaded_Linux::GetUSBStorageDevices
-
ThreadedMemoryCardWorker inherits RageWorkerThread, which seems to be timeout-able thread worker
- It runs heartbeat every 0.1 seconds it seems?
- It waits 0.1 seconds from when the last heartbeat function has finished
-
Running heartbeat means running DoHeartbeat method
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 re | |
import asyncio | |
from pymongo import MongoClient | |
from pymongo.collection import Collection as MongoCollection | |
from pymongo.results import InsertOneResult, UpdateResult, DeleteResult | |
from typing import Awaitable, Self | |
mongo: MongoClient = None | |
DATABASE_NAME = "kokomemo" |
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 re | |
import json | |
import requests | |
IP_REGEX = re.compile(r"\nip=((?:[0-9]{,3}\.){3}[0-9]{,3})\n") | |
token = "" | |
zone = "" | |
CDN_CGI = "https://cloudflare.com/cdn-cgi/trace" |
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 os | |
import time | |
from math import floor | |
class SnowflakeGenerator: | |
def __init__(self, mid=None, time_start=1288834974657): | |
self.time_start = time_start | |
self.mid = mid if mid else os.getpid() |
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
server.modules=("mod_cgi") | |
server.breakagelog="/var/log/cgi_error.log" | |
server.document-root="/tmp/www" | |
server.port=1727 | |
cgi.assign=(".cgi"=>"") |
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 json | |
import requests | |
from bs4 import BeautifulSoup as bs | |
URL = "https://www.piugame.com/piu.ucs/ucs.sample/ucs.sample.alltunes.php?page={}" | |
PAGES = 11 | |
def get_page(pagenum): |
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
#!/bin/env python3 | |
import os | |
import re | |
def get_usbdevices(exclude=[]): | |
usbs = [x for x in os.listdir("/dev/disk/by-path") if "usb" in x] | |
usbs = sanitize_parts(usbs) | |
return [x for x in usbs if x not in exclude] | |
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
installs=() | |
configs=() | |
install_ITGmania () { | |
if [ -d /mnt/stepmania/itgmania ]; then | |
echo "Seems like ITGmania is already installed. Do you want to update it to newer version?" | |
echo "WARNING: This will overwrite the directory with new version!" | |
read -p "Proceed? (y/n): " -n1 ANSWER | |
echo |
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 pygame | |
import time | |
class SmoothMove: | |
def __init__(self, surface, orig, dest, duration): | |
self.surface = surface | |
self.orig = orig | |
self.dest = dest |
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 sys | |
import time | |
target_str = sys.argv[-1] if len(sys.argv) > 1 else input("target bpm: ") | |
target = float(target_str) | |
spb = 1 / target * 60 | |
input("Waiting for start...") |
NewerOlder