Skip to content

Instantly share code, notes, and snippets.

Seek and ye shall find

Azhar Khan azhar22k

Seek and ye shall find
View GitHub Profile
azhar22k / gist:42d76b6c56c31f447b84dbeafbe8b7e6
Created Feb 28, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:42d76b6c56c31f447b84dbeafbe8b7e6


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
azhar22k /
Created May 15, 2017
Sample code to connect to MS SQL Server using python3
def sqlServerConnect(driverType,pip, pdbname, pusername="", ppwd=""):
from pyodbc import connect
#trying to create a cnnection
connection = connect(driver=driverType, host=pip, database=pdbname, user=pusername,password=ppwd)
print("Connection successful : "+driverType+" "+pip+" "+" "+pdbname+" "+pusername)
return connection
except Exception as e:
#connection creation failed
azhar22k / Numpy.json
Created Sep 1, 2016
Numpy Array Practice via introduction
View Numpy.json
"cells": [
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"outputs": [],
"source": [
azhar22k /
Created Aug 21, 2016
Python script to open google maps of a place, either using clipboard or command line arguments
#webbrowser module helps in open default web browser of os
from webbrowser import open
#sys contains command line arguments
from sys import argv
#pyperclip is a third party module used to access clipbord
#pip3 install pyperclip
#python3 -m pip install pyperclip
from pyperclip import paste
if len(argv)>1:
address = " ".join(argv[1:])
import pyperclip
c=input('Enter text you want to copy: ')
print('\n'+c+" is on your clip board now, press any key to paste it on stdoutput")
azhar22k /
Created Jun 30, 2016
Program to read birthdate and display birthday month and calculate days till next birthday
#Read birthdate and display birthday manth
import datetime
birthday=input("What is your birthday date['yyyy-mm-dd' format] ")
print("Birthday month is "+birthday.strftime('%B'))
azhar22k /
Created Jun 30, 2016
The following script tells the size of directory in which it is run. Tested on Unix but should also work with with Windows
import os
totalSize = 0
for filename in os.listdir(os.getcwd()):
if not os.path.isfile(os.path.join(os.getcwd(),filename)):
totalSize = totalSize + os.path.getsize(os.path.join(os.getcwd(),filename))
print("Total Size of current working directory is {0:.2f} Kilo bytes".format(totalSize/1024))