This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create all the tables | |
CREATE TABLE doctors ( | |
id SERIAL PRIMARY KEY, | |
status SMALLINT NOT NULL, | |
doctor_name VARCHAR(512) NOT NULL | |
); | |
CREATE TABLE slots ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def download_single_image(self, url, file_name): | |
with open(self.image_path + file_name.replace(' ', '_') + '.jpg', 'wb') as file: | |
response = requests.get(url, stream=True) | |
for block in response.iter_content(1024): | |
if not block: | |
break | |
file.write(block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package total.nooflines; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.BufferedReader; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
public class TotalNoOfLines { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
class NoOFLinesInAProject: | |
project_path = '' | |
def __init__(self): | |
self.project_path = input('Enter Project Path: ') | |
def total_lines(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from: https://stackoverflow.com/a/49207730/5600965 | |
# This requires BeautifulSoup | |
# cfemail = element.__dict__['attrs'].get('data-cfemail') | |
def get_protected_email(cfemail): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from: https://stackoverflow.com/a/52969463/5600965 | |
from PIL import Image | |
def pad_image(original_image, **kwargs): | |
width, height = 200, 64 | |
ratio_width = width / original_image.width | |
ratio_height = height / original_image.height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
How to use this view ? | |
---------------------- | |
class YourFileOpenView(FileOpenView): | |
folder_path = 'path of the folder where the file is' | |
file_name = 'name of the file to be downloaded' | |
content_type_value = 'content type used for the format of `file_name`' | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
How to use this view ? | |
---------------------- | |
class YourFileDownloadView(FileDownloadView): | |
folder_path = 'path of the folder where the file is' | |
file_name = 'name of the file to be downloaded' | |
content_type_value = 'content type used for the format of `file_name`' | |
""" |