Skip to content

Instantly share code, notes, and snippets.


Matt Harzewski mattvh

View GitHub Profile
mattvh /
Last active Dec 21, 2020
Example for Medium article "Python Decorators Explained"
def decorate(func):
print("Do something before func()")
return func #return the original function, unmodified
def hello():
print("Hello, world!")
mattvh /
Created Jun 7, 2020
Writing a GUI Application with Python and Py2App
from setuptools import setup
APP = ['']
'argv_emulation': True,
'site_packages': True,
#'iconfile': 'appicon.icns',
'packages': ['wx', 'requests'],
'plist': {
mattvh / _layout.html
Created May 29, 2020
Baking Static Sites with Python and Jinja
View _layout.html
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>{{ title }}</title>
<link rel="stylesheet" href="static/style.css">
<div class="container">
mattvh / smstranscript.rb
Created Jul 7, 2017
Turns an iMessage conversation from an iPhone backup into an HTML transcript. MIT license.
View smstranscript.rb
# Converts an iPhone SMS.db file into HTML
# Mac: Library > Application Support > MobileSync > Backup
# Windows: C:\Users\<user name>\AppData\Roaming\Apple Computer\MobileSync\Backup
# Find the folder with the most recently modified date and open it.
# Locate the 3d0d7e5fb2ce288813306e4d4636395e047a3d28 file and copy it to the location of this script.
# Rename the file to "db.sqlite"
# Replace HANDLE_GOES_HERE with the phone number/etc identifying the other party in the DB.
# Run the script.
require "sqlite3"
mattvh / nudgemode.lua
Created Jul 27, 2015
Hammerspoon NudgeMode module
View nudgemode.lua
-- Window nudging and resizing with modal shortcuts
-- Initialize with desired mode keybind:
-- windowmode.init({"cmd", "alt", "ctrl", "shift"}, "m")
-- Nudge window with arrows, resize with shift and arrows
-- HJKL is also supported
-- Space or return exits nudge mode
-- ------------------------------------------------------
mattvh / imgur-tweetbot-api2.php
Created Oct 26, 2013
This is the original code from my tutorial on how to use the Imgur API with Tweetbot for Mac. Imgur has since iterated their API, which requires a new script. I'm just archiving the old one here, while I update the post for version 3.
View imgur-tweetbot-api2.php
class TweetbotImgurEndpoint {
private $api_key;
private $api_url = "";
private $file_temp_location;
private $file_name;
mattvh / favicon.rb
Last active Sep 4, 2020
Discovering and saving favicons with Ruby
View favicon.rb
# by Matt Harzewski
# Read more:
require "httparty"
require "nokogiri"
require "base64"
class Favicon