Tuesday, October 18, 2016

Delete outlook mails

Unfortunate chain of events during some testing conducted by my colleague led to a full folder in my outlook. When I say full I mean ~7M emails generated during test that lasted a couple of minutes.

Python to the rescue (outlook needs to run during this operation)...
 
import win32com.client

outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.Folders["testnotifications"].Folders["Inbox"]

messages = inbox.Items
for message in messages:
    print("Deleting a message %s" % message.Subject )
    message.Delete()
deleted = outlook.Folders["testnotifications"].Folders["Deleted Items"]

while True:
    message = deleted.Items.GetLast()
    print("Deleting a message %s" % message.Subject)
    message.Delete()
print("Done")

Friday, August 5, 2016

Elixir and Phoenix, love at first sight

These days I am reading a lot about Elixir and Phoenix. I still didn't have the time to try them out but I fell in love by just reading the texts. Read this and this and tell me, doesn't it sound beautiful?

I have a bunch of materials that I gathered during the years that would help me switch to functional programming. The only peace from that pile that I invested more time was SICP which I would warmly recommend. That other stuff is just collecting the dust :)
I hope Elixir/Phoenix combination will help transition.

[EDIT:] And apparently, the whole thing is on fire. Just 5 minutes after I published this post it has 5 views. <3 p="">