Posts

Showing posts from 2017

Angularjs with initialize the variable

<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> <div ng-app="" ng-init="firstName='John'"> <p>The name is <span ng-bind="firstName"></span></p> </div> </body> </html>

Angularjs for responsive UI

Image
<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> <div ng-app=""> <p>Input something in the input box:</p> <p>Name : <input type="text" ng-model="name" placeholder="Enter name here"></p> <h1>Hello {{name}}</h1> </div> </body> </html>

Basic Git Command for first time github user

The directory we decided to name "box". To initialize a Git repository here, type the following command: $ git init "box" directory now has an empty repository in /.git/. The repository is a hidden directory where Git operates. let's type the git status command to see what the current state of our project is: $ git status

Python IMAP list response, listing mailboxes, mailbox status, selecting_mailbox, searching messages, search criteria, fetching messages, whole messages, uploading messages, moving and copying messages, deleting messages, delete mailbox,search with uid

#  https://github.com/sanuptpm/imap import imaplib import re import email import time import email.message from imap_conf import open_connection list_response_pattern = re.compile(r'\((?P<flags>.*?)\) "(?P<delimiter>.*)" (?P<name>.*)') # print "list_response_pattern :", list_response_pattern def parse_list_response(line):     flags, delimiter, mailbox_name = list_response_pattern.match(line).groups()     mailbox_name = mailbox_name.strip('"')     return (flags, delimiter, mailbox_name) # Listing mailboxes def listing_mailboxes():     resp, data = c.list()     # IMAP instance     print "\nIMAP4_SSL instance :", c     # First parameter of the c.list()     print '\nResponse code:', resp     # Second parameter of the c.list()     print "\nmailboxes available for an account :", data     # Get the status     for line in data:         print '\nServer response:', line         #  call for flags, d

How to configure IMAP in python

import imaplib def open_connection ( verbose = False ): # Connect to the server connection = imaplib.IMAP4_SSL( ' servername ' ) # Login to our account connection.login( ' username ' , ' password ' ) return connection # if __name__ == '__main__': # c = open_connection(verbose=True) # try: # resp, data = c.list() # print "\nIMAP4_SSL instance :", c # print '\nResponse code:', resp # print "\nmailboxes available for an account :", data # finally: # c.logout()