Skip to content

Instantly share code, notes, and snippets.

View zlhaa23's full-sized avatar

zlhaa23 zlhaa23

View GitHub Profile
@zlhaa23
zlhaa23 / grade.py
Last active February 28, 2018 14:07
Canvas grading
"""
An interactive CLI script for entering grades on Canvas (an LMS).
Python 3.6+
Usage:
1. Export the CSV file with Canvas
2. Modify the file with this script
3. Import the modified file to Canvas
Tip: use rlwrap.
@zlhaa23
zlhaa23 / animte.sh
Last active December 16, 2017 03:26
Convert images to gif / mp4
# ImageMagick
convert -delay 50 +page *.png -loop 0 animated.gif
# FFmpeg
ffmpeg -framerate 30 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p movie.mp4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
'''
Example:
python email_notify.py smtp-mail.outlook.com 587 ######## from@outlook.com to@outlook.com "Hello from Python" "Lunch is ready"
'''
import sys
import smtplib
from email.mime.text import MIMEText
_, host, port, password, fromaddr, toaddr, subject, content = sys.argv
@zlhaa23
zlhaa23 / requests_via_tor_demo.py
Last active August 29, 2015 14:18
Use Tor to send HTTP requests from multiple IP addresses
# https://stem.torproject.org/tutorials/to_russia_with_love.html#using-socksipy
# http://segmentfault.com/q/1010000000511783/a-1020000000512182
# https://github.com/kennethreitz/requests/pull/478#issuecomment-24914571
# Python 3
import socket
import time
# pip install requests
import requests