Skip to content

Instantly share code, notes, and snippets.

@mickeypash
Created July 2, 2020 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mickeypash/be89e4d745d25b3db29a448c8ea7e41f to your computer and use it in GitHub Desktop.
Save mickeypash/be89e4d745d25b3db29a448c8ea7e41f to your computer and use it in GitHub Desktop.
Add this program to your path; Sign up for these sites; When you find a few spare minutes just run it.
#!/usr/bin/env python
import random
import webbrowser
import argparse
urls = {
"keybr": "http://keybr.com/",
"pocket": "https://getpocket.com/random",
"worldindata": "https://ourworldindata.org/",
"memoryleague": "https://memoryleague.com/#!/train",
"readwise": "https://readwise.io/dailyreview",
}
def main(args):
if args.selection == "all":
webbrowser.open(random.choice([u for u in urls.values()]))
else:
webbrowser.open(urls[args.selection])
def setup():
parser = argparse.ArgumentParser(description="📝 Have a few spare minutes? Get productive!")
parser.add_argument("-s", "--selection",
choices=["keybr", "pocket", "readwise", "all"], default="all",
help="Select a specific thing you want to work on.")
args = parser.parse_args()
return args
if __name__ == '__main__':
args = setup()
main(args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment