Skip to content

Instantly share code, notes, and snippets.

View 404Wolf's full-sized avatar

Wolf Mermelstein 404Wolf

View GitHub Profile
@404Wolf
404Wolf / conjunct.py
Last active March 29, 2023 04:57
NATuG Junction Creation
def conjunct(self, NEMid1: NEMid, NEMid2: NEMid, skip_checks: bool = False) -> None:
"""
Create a cross-strand or same-strand junction between two NEMids.
The way that the conjuncting works depends on whether the NEMids are in the
same strands, and the closed-ness of the strands that the NEMids are in.
If the NEMids are in the same strand, and the strand is open, then a closed
loop will be formed and there will be a remainder open strand. If they are in
the same strand and the strand is closed, then the large closed loop will be
import aiohttp
import logging
import asyncio
logger = logging.getLogger(__name__)
async def isAlive(proxy: str, session: aiohttp.ClientSession(), timeout=5, retries=2) -> bool:
"""
Check if a proxy is alive.
@404Wolf
404Wolf / board.py
Last active April 1, 2023 03:57
A simple tictactoe game implementation in Python
from string import ascii_uppercase
from typing import Tuple, Literal
class Board:
"""
A tictactoe board.
A container to hold the current state of the game and provide useful methods like
checking whether a player has won.
@404Wolf
404Wolf / config.json
Last active May 10, 2023 01:39
Automatically mount all my Google Drives with Rclone
{
"rclone": {
"path": "C:\\Users\\wolfm\\Rclone",
"logs": "C:\\Users\\wolfm\\Rclone\\logs",
"bufferSize": "256M",
"cacheMode": "full"
},
"sources": {
"school": {
"name": "School",
@404Wolf
404Wolf / engine.py
Last active June 26, 2023 17:56
Render a chrome-viewable file to a PDF with python
import atexit
import base64
import os
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
service = Service(ChromeDriverManager().install())
import subprocess
import psutil
import logging
from time import sleep
logging.basicConfig(filename='rdp.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
logging.info("Program started")
killed = False
for process in psutil.process_iter(['pid', 'name']):