Skip to content

Instantly share code, notes, and snippets.

@tanimislam
tanimislam / test_email.py
Created January 3, 2021 20:15
testing email functionality using sender and recipient with user-defined port number
#!/usr/bin/env python3
import os, sys, numpy, smtplib, logging, datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from argparse import ArgumentParser
def test_simple_email( recipient, sender, port_number ):
"""
send a simple test email from ``recipient`` to ``sender``, at ``port_number`` on the local machine, using the SMTP_ protocol.
@tanimislam
tanimislam / demo_create_movie_sequence.py
Created July 6, 2020 05:25
Sequence of images into an MP4 file
#!/usr/bin/env python3
"""
I developed this Python CLI script to demonstrate creating an MP4 movie from an image sequence.
I follow instructions from https://hamelot.io/visualization/using-ffmpeg-to-convert-a-set-of-images-into-a-video. I make an MP4 movie that is 5 FPS with psychovisual quality of 25.
"""
import os, sys, numpy, subprocess, glob, re, logging, time
from PIL import Image
from distutils.spawn import find_executable
from argparse import ArgumentParser
@tanimislam
tanimislam / demonstration_musicbrainz_picard.py
Created March 21, 2020 17:19
This is a demonstration using Picard's API to search for artists, albums, tracks
#!/usr/bin/env python3
@tanimislam
tanimislam / .gitignore
Last active March 12, 2020 20:07
description of something that creates nonsensical images when using Python's multiprocessing framework
*.png
@tanimislam
tanimislam / .gitignore
Last active January 16, 2020 06:57
download_slashdot_by_year
# old URL: https://gist.github.com/tanimislam/305f551f09ceaffff2b8e142dd8c5e31
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# MS word and latex extensions
*.bak
*.aux
*.log
@tanimislam
tanimislam / .gitignore
Last active February 27, 2020 20:33
This converts an MP4 movie, with SRT file, and name and year into an MKV file with English subtitles
# don't upload the database
# app.db
*.core
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# MS word and latex extensions
*.bak
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
from icalendar import Calendar, Event
from bs4 import BeautifulSoup
import pytz, datetime, os, sys
from requests.compat import urljoin
from optparse import OptionParser
def get_events_from_html( htmlfile ):
html = BeautifulSoup( open( htmlfile, 'r' ), 'lxml' )
@tanimislam
tanimislam / tracpac.py
Last active March 17, 2016 23:19
This will give you the latest information on your USPS package. Just give it the USPS tracking number of your package, and it will give you a status or summary if valid. Requires PyQt4 and requests to run.
#!/usr/bin/env python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import requests, os, sys
from xml.etree import ElementTree
"""
This will give you the latest information on your USPS package. Just
give it the USPS tracking number of your package, and it will give you
@tanimislam
tanimislam / demo.html
Last active December 5, 2015 00:16
demo LaTeX code to test Ryver
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
</head>