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
def find_dic_in_list(list,key): | |
for (index, d) in enumerate(list): | |
if dict(d).keys().__contains__(key): | |
return d[key] | |
return None |
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
from docx import Document | |
from datetime import datetime | |
months = ['Jänner','Februar','März','April','Mai','Juni','Juli','August','September' | |
,'Oktober','November','Dezember'] | |
def main(): | |
position = input("Position :") | |
website = input("WebSite :") | |
company = input("Company :") |
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
def dumps(data): | |
return json.dumps(data, indent=4, sort_keys=True, default=str) |
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
def Result(state, description): | |
return json.dumps({ | |
"State": state, | |
"Description": description | |
}) |
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
def Result(state, description): | |
return json.dumps({ | |
"State": state, | |
"Description": description | |
}) |
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
def upload_image_from_base64(encoded, item, value, filename): | |
if str(item).lower() == "profile": | |
with open(get_user_profile_dir(value, filename), "wb") as fh: | |
temp = str(encoded).encode('utf-8') | |
temp = base64.b64decode(temp) | |
fh.write(base64.b64decode(temp)) | |
return True | |
return False | |
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
days = ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] | |
today_date = datetime.datetime.today() | |
last30date = today_date - datetime.timedelta(days=30) | |
todayname = today_date.strftime("%A") | |
startweek = "" | |
endweek = "" | |
if todayname == days[0]: | |
startweek = today_date | |
else: | |
index = days.index(todayname) |
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
<div> | |
<p> *** OTHER STUFF HERE ***<p/> | |
<table id="gable" border="1" style="width: 100%"> | |
<colgroup> | |
<col class="twenty" /> | |
<col class="fourty" /> | |
<col class="thirtyfive" /> | |
<col class="twentyfive" /> | |
</colgroup> | |
<tr> |
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
# Sample Gunicorn configuration file. | |
# | |
# Server socket | |
# | |
# bind - The socket to bind. | |
# | |
# A string of the form: 'HOST', 'HOST:PORT', 'unix:PATH'. | |
# An IP is a valid HOST. | |
# |
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
data = {"_id":"5c62ff5cdc6e89000ac76dc8" | |
,"Answers":[ | |
{"Text":"text1","Point":2}, | |
{"Text":"text2","Point":1}, | |
{"Text":"Hallo","Point":3} | |
] | |
a = db.aggregate( | |
[ {"$match":{"_id":objectid.ObjectId("5c62ff5cdc6e89000ac76dc8")}}, | |
{ "$unwind": '$Answers'}, |
OlderNewer