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
| {% block head %} | |
| {{ super() }} | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.css" /> | |
| {% endblock %} | |
| ... | |
| {% block content %} | |
| <div class="container"> |
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
| {% block content %} | |
| <div class="container"> | |
| {% block page_content %}{% endblock %} | |
| <button onclick="myFunction()">Click Me</button> | |
| <div id="upload" class="row"> | |
| Some text | |
| </div> | |
| </div> |
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.path, time | |
| UPLOAD_FOLDER = 'static/uploaded_images' | |
| # exclude .json file | |
| files = ['/'.join((UPLOAD_FOLDER, file)) \ | |
| for file in os.listdir(UPLOAD_FOLDER) if 'json' not in file] | |
| last_modified_files = [(file, os.path.getmtime(file)) for file in files] | |
| last_modified_files = sorted(last_modified_files, key=lambda t: t[1], reverse=True) |
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
| References | |
| - https://bootsnipp.com/snippets/featured/simple-responsive-image-gallery | |
| /*gallery*/ | |
| img.gal { | |
| filter: gray; /* IE6-9 */ | |
| -webkit-filter: grayscale(1); /* Google Chrome, Safari 6+ & Opera 15+ */ | |
| -webkit-box-shadow: 0px 2px 6px 2px rgba(0,0,0,0.75); | |
| -moz-box-shadow: 0px 2px 6px 2px rgba(0,0,0,0.75); | |
| box-shadow: 0px 2px 6px 2px rgba(0,0,0,0.75); |
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
| <form action="{{ url_for('save_user_feedback') }}" method=post> | |
| <div class='form-group'> | |
| <button type="submit" name='y' value="cat" class="btn btn-success">Cat</button> | |
| <button type="submit" name='y' value="dog" class="btn btn-success">Dog</button> | |
| <button type="submit" name='y' value="others" class="btn btn-success">Others</button> | |
| </div> | |
| </form> |
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
| <h3>Upload new Images</h3> | |
| <form method=post enctype=multipart/form-data> | |
| <div class='form-group'> | |
| <label class="btn btn-default btn-file"> | |
| Browse <input type="file" name=file style="display: none;"> | |
| </label> | |
| <button type="submit" class="btn btn-success">Upload</button> | |
| </div> | |
| </form> |
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
| #Pickle save: | |
| import cPickle as pickle | |
| with open('data.p', 'wb') as fp: | |
| pickle.dump(data, fp) | |
| #Pickle load: | |
| with open('data.p', 'rb') as fp: | |
| data = pickle.load(fp) |
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
| # encoding: utf-8 | |
| from __future__ import print_function | |
| from __future__ import unicode_literals | |
| import os | |
| import json | |
| import boto3 | |
| import logging | |
| import gspread | |
| from oauth2client.service_account import ServiceAccountCredentials |
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
| with tf.Session(graph=graph) as sess: | |
| # initialize weights | |
| tf.global_variables_initializer().run() | |
| # write to log for tensorboard | |
| writer = tf.summary.FileWriter(LOG_DIR) | |
| writer.add_graph(sess.graph) |