Skip to content

Instantly share code, notes, and snippets.

View volovikariel's full-sized avatar
🦒
Stay awesome

Ariel Volovik volovikariel

🦒
Stay awesome
View GitHub Profile
@volovikariel
volovikariel / myeval.py
Last active March 28, 2024 16:39 — forked from iafisher/myeval.py
A simple implementation of a recursive-descent parser for a language of boolean expressions.
"""
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.
@volovikariel
volovikariel / script.js
Created December 27, 2022 00:43
GMail download attachments to drive
/**
* 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.