Skip to content

Instantly share code, notes, and snippets.

View beantowel's full-sized avatar

Cao Apologize for Overflow beantowel

View GitHub Profile
@beantowel
beantowel / README.md
Created September 21, 2023 10:01
one file header only log for c++11

copy, paste and log!

one-file convenient code for simple logging.

  • c++11 compatible
  • header only
  • type-safe formatting

example

@beantowel
beantowel / thumbnail.py
Created January 30, 2023 17:00
Resize and crop to generate thumbnails for unity asset store
from PIL import Image
def resize_and_crop(img_path, modified_path, size, crop_type="top"):
"""
Resize and crop an image to fit the specified size.
args:
img_path: path for the image to resize.
modified_path: path to store the modified image.
@beantowel
beantowel / JSBSim.cs
Last active February 8, 2023 16:09
JSBSim.cs for deserialization of jsbxim aircraft configuration xml files
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
@beantowel
beantowel / download.py
Created February 7, 2020 17:10
Warthunder Server Replay Downloader
import aiohttp
import asyncio
import socket
import time
import os
def getUrls(rid, count, directory):
url = f"http://wt-game-replays.warthunder.com/{rid}/"
urlList = []
pathList = []
@beantowel
beantowel / getSongFromYoutube.py
Created July 29, 2019 06:14
script for downloading MTG-QBH dataset collection
import os
import click
import re
import csv
import numpy as np
from selenium import webdriver
from bs4 import BeautifulSoup
from urllib.parse import quote_plus
YOUTUBE_QUERY = 'https://www.youtube.com/results?search_query='
@beantowel
beantowel / gistPost.py
Created March 22, 2019 02:31
post system information to gist file
import click
import time
import timeout_decorator
import subprocess
import requests
import datetime
import socket
import re
@beantowel
beantowel / fragViewGen.py
Created September 15, 2018 12:08
generate .stl format mesh from fragmented text
from PIL import Image, ImageFont, ImageDraw
from stl import mesh
from mpl_toolkits import mplot3d
from matplotlib import pyplot as plt
from cv2 import cv2
import itertools as its
import numpy as np
import random
import sys