Skip to content

Instantly share code, notes, and snippets.

View Stovoy's full-sized avatar

Stovoy

View GitHub Profile
import subprocess
import sys
def main() -> int:
result = subprocess.run(["git", "status"], capture_output=True, text=True)
if result.stdout:
sys.stdout.write(result.stdout)
if result.stderr:
sys.stderr.write(result.stderr)
import math
import pygame
import random
class Ecosystem:
def __init__(self, width, height):
self.width = width
self.height = height
@Stovoy
Stovoy / convert_webp_to_gif.py
Created April 17, 2023 21:17
A script to convert an animated webp image to gif
from PIL import Image
def convert_webp_to_gif(webp_file, gif_file):
# Open the WEBP file using the PIL library
webp_image = Image.open(webp_file)
# Initialize lists to store the frames and durations of the WEBP image
frames = []
durations = []
import asyncio
import aiohttp
from bs4 import BeautifulSoup
base_url = "https://control.fandom.com"
all_collectibles = "/wiki/Collectibles/List_of_Collectibles"
def stats(text):
# Minimum moves solver for https://www.funnyhowtheknightmoves.com/
from collections import deque
import chess
def main():
destinations = [chess.F8, chess.E8, chess.C8, chess.B8,
chess.H7, chess.G7, chess.E7, chess.C7, chess.A7,
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using CommunityToolkit.HighPerformance;
public struct Position {
public float x;
public float y;
};
public class TestStructModification {
@Stovoy
Stovoy / rotate_pennies.py
Last active December 14, 2022 15:56
A script to correct the rotation of pennies using OpenCV
import argparse
import math
import multiprocessing
import os
import itertools as it
from scipy import ndimage
from skimage.metrics import structural_similarity
import cv2
import numpy as np
import math
import time
import pygame
class Vector:
def __init__(self, p1, p2):
self.x1, self.y1 = p1
self.x2, self.y2 = p2
package main
import (
"fmt"
"sort"
"strings"
)
type Shape struct {
grid [][]bool
use rdev::{simulate, grab, Event, EventType, Key};
static mut SIMULATED: u32 = 0;
fn main() {
if let Err(error) = grab(callback) {
println!("Error: {:?}", error)
}
}