- Zero Downtime
- Graceful shutdowns
- Via Github Actions
- Zero infrastructure management overhead
The general idea is to have Github Actions test, build and deploy a Rails app to Google Cloud Compute Engine.
| # connect to mail server using IMAP | |
| client = ImapClient("imap.gmail.com", 993, "username", "password") | |
| # select folder | |
| client.select_folder("Inbox") | |
| # loop through email messages and save them as .eml files | |
| for msg in client.list_messages(): | |
| print("Subject: " + msg.subject) | |
| print("HtmlBody: " + msg.html_body) |
| ##Longest Substring with At Most K Distinct Characters | |
| var lengthOfLongestSubstringKDistinct = function(s, k) { | |
| //incase the length of the string is the same or less than the distict number then return the length of the string. | |
| if(k >= s.length ){ | |
| return s.length; | |
| } | |
| //define an empty hash map variable. | |
| let hmap = {} | |
| let max = 0; | |
| //iterating through the string. |