This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple implementation of a recursive-descent parser for a language of boolean expressions. | |
Forked from: https://gist.github.com/iafisher/6f53ce4df29c91ac9276c13a113ccf9f | |
This fork aims to allow for strings instead of 0 and 1 symbols, and these strings themselves are then to be evaluated. | |
e.g: Instead of (0 or 1), you could have (is_happy or is_sad). | |
Additionally, allow for multiple operators within a single set of parentheses, not only boolean. | |
e.g: Allow for (0 or 1 or 2 or 3 or 4 or 5 ...) | |
Note that only a single operator type is allowed however, as it'd be ambiguous otherwise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Script to paste into GMail to search through an inbox that contains attachments, and download them to your drive if possible. | |
* Does it in paralell (or concurrently...not too sure which it is...we have different chrome tab, so different threads, so parallel is possible, | |
* but all the functions being called are in the same file, so it may still be only running concurrently) to speed things up! | |
* | |
* Note: Error handling is quite bad, so if an error ever occurs, we simply close all the open pages. | |
* This is to avoid having a situation where 1 out of 1000 emails has an undownloaded file, good luck tracking that! | |
* Though frankly, this is probably handle-able through some logging + some retries...not too sure. | |
* | |
* Note 2: Maybe not a good idea to actually use this, probably goes against some anti-botting TOS. |