Skip to content

Instantly share code, notes, and snippets.

@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"""
@wpm
wpm / poll.js
Last active November 14, 2019 09:59
Javascript Polling with Promises
var Promise = require('bluebird');
/**
* Periodically poll a signal function until either it returns true or a timeout is reached.
*
* @param signal function that returns true when the polled operation is complete
* @param interval time interval between polls in milliseconds
* @param timeout period of time before giving up on polling
* @returns true if the signal function returned true, false if the operation timed out
*/