Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Booth.pm Download All
// @namespace http://tampermonkey.net/
// @author a1678991
// @version 1.0
// @description Add a "Download All" button to purchased items on Booth.pm
// @match https://accounts.booth.pm/library*
// @grant none
// ==/UserScript==
processor : 0
vendor_id : AuthenticAMD
cpu family : 25
model : 17
model name : AMD EPYC 9654P 96-Core Processor
stepping : 1
microcode : 0xa101144
cpu MHz : 1500.000
cache size : 1024 KB
physical id : 0
# Function to check if the script is running as Administrator
function Test-IsAdmin {
$currentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
return $currentUser.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
}
# If not running as Administrator, restart the script with elevated privileges
if (-not (Test-IsAdmin)) {
Write-Output "Restarting script with elevated privileges..."
Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
// ==UserScript==
// @name Hugging Face Clone Button
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Adds a button to Hugging Face repository pages to easily copy the git clone command to the clipboard.
// @author a1678991
// @match https://huggingface.co/*
// @grant GM_setClipboard
// ==/UserScript==
@a1678991
a1678991 / ttl-serial-proxy.ino
Created February 23, 2024 09:02
esp32をシリアルのレベルシフター代わりにするやつ
#include <cmath>
#include <HardwareSerial.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
const int SERIAL_RX_PIN = 16; // シリアル受信ピン
const int SERIAL_TX_PIN = 17; // シリアル送信ピン
const int SERIAL_BAUD_RATE = 115200; // シリアルのボーレート
const int SERIAL_LOOP_DELAY_MS = 0.1; // ループ毎の待機時間
const int LED_RX_PIN = 2; // 受信用LEDのピン
@a1678991
a1678991 / HierarchyHighlighter.cs
Last active February 21, 2024 11:30
EditorOnlyに指定されているGameObjectをわかりやすく表示するやつ
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
public class HierarchyHighlighter
{
static HierarchyHighlighter()
{
EditorApplication.hierarchyWindowItemOnGUI += HierarchyItemCB;
}
import pandas as pd
import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt
import argparse
from typing import List, Dict, Optional
def parse_kml(file_path: str) -> ET.Element:
"""
Parses a KML file and returns the root of the XML tree.
@a1678991
a1678991 / webui-user.sh
Last active November 11, 2023 10:20
stable-diffusion-webui python3.11 + CUDA12 + TensorRT + xformers TORCH_COMMAND
# TensorRT
export COMMANDLINE_ARGS="--xformers"
export TORCH_COMMAND="pip install -U pip wheel build setuptools pyproject.toml fonts ninja colored onnxruntime && \
pip install -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 && \
pip install -U --pre tensorrt --extra-index-url https://pypi.nvidia.com && \
pip install -U polygraphy onnx-graphsurgeon --extra-index-url https://pypi.ngc.nvidia.com && \
pip install -U 'httpx==0.24.*' protobuf==3.20.2"
@a1678991
a1678991 / Dockerfile
Created October 8, 2023 20:03
steamcmd in arm64 container (DOES NOT WORK)
FROM debian:stable-slim as box
RUN dpkg --add-architecture armhf
RUN apt-get update && apt-get full-upgrade -y
RUN apt-get install -y git binfmt-support build-essential cmake python3 python3-pip gcc-arm-linux-gnueabihf libc6-dev-armhf-cross libc6:armhf libncurses5:armhf libstdc++6:armhf && apt-get clean
# install box86 and box64
RUN mkdir -p /home/user/box/usr/share/binfmts/
WORKDIR /build
ADD https://api.github.com/repos/ptitSeb/box86/releases/latest latest_box86
RUN git clone https://github.com/ptitSeb/box86
@a1678991
a1678991 / userscript.js
Created December 12, 2021 15:45
ダウンロードページ開いたら勝手にダウンロードして戻る
// ==UserScript==
// @name Nexus Auto Downloader
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Auto download files with "SLOW DOWNLOAD"
// @author @a1678991
// @match https://www.nexusmods.com/*/mods/*?tab=files&file_id=*
// @grant none
// ==/UserScript==