Skip to content

Instantly share code, notes, and snippets.

View rizumu's full-sized avatar
:octocat:

Thomas Schreiber rizumu

:octocat:
View GitHub Profile
width = models.PositiveIntegerField(_("height"), db_index=True)
height = models.PositiveIntegerField(_("width"), db_index=True)
def is_horizontal(self):
if float(self.height) / self.width <= 0.7:
return True
def is_vertical(self):
if float(self.height) / self.width > 0.7:
return True
@rizumu
rizumu / sitecrawler.py
Created October 17, 2017 02:02
A simplistic website crawler that extracts links recursively using breath first traversal
#!/usr/bin/env python
# Assumes the BeautifulSoup4 and Requests libraries are installed.
# pip install bs4 requests
import requests
from bs4 import BeautifulSoup
from requests.compat import urljoin
@rizumu
rizumu / wavtosnd.py
Created December 2, 2023 07:07 — forked from tattlemuss/wavtosnd.py
A very simple and hacky Python3 script to convert 16-bit uncompressed WAV files to MPC-3000 .SND files.
#!/usr/bin/env python3
"""
A very simple and hacky Python3 script to convert 16-bit uncompressed WAV
files to MPC-3000 .SND files.
The output is modelled to copy the output of Wav2Snd
(http://www.mpc3000.com/wavsnd.htm) but this might be a bit more portable
to run on modern machines.
npub1857yljp0gyd22gwpfqhhu9a86mn8p6eue79re0pe7cvvdwzvrwzshktw9u