Skip to content

Instantly share code, notes, and snippets.

@mikez
mikez / close-other-apps
Last active April 15, 2022 20:59
Close all apps except the frontmost visible one. macOS only.
#!/bin/bash
# get frontmost app
frontmost_app=$(osascript -e '
tell application "System Events"
POSIX path of (file of application processes whose frontmost is true and visible is true)
end tell
')
escaped_frontmost_app=${frontmost_app//\//\\/}
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@karlcow
karlcow / emlx.py
Last active July 3, 2022 09:00
Parsing emlx files on Mac OS X. Apple Proprietary Storage Format for emails.
#!/usr/bin/env python
# encoding: utf-8
"""emlx.py
Class to parse email stored with Apple proprietary emlx format
Created by Karl Dubost on 2013-03-30
Inspired by Rui Carmo — https://the.taoofmac.com/space/blog/2008/03/03/2211
MIT License"""