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
| # ----------------------------------------------------------------------- | |
| # Defining MIME types to ensure the web server actually knows about them. | |
| # ----------------------------------------------------------------------- | |
| <IfModule mod_mime.c> | |
| AddType application/javascript js | |
| AddType application/vnd.ms-fontobject eot | |
| AddType application/font-woff2 woff2 | |
| AddType application/x-font-ttf ttf ttc | |
| AddType font/opentype otf |
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
| class AdminFAQView(AdminView): | |
| def __init__(self): | |
| self.form = FAQQuestionForm() | |
| self.questions = db.session.query(Question.id, Question.question).all() | |
| def get(self, question_id=None): | |
| form = self.form | |
| questions = self.questions |
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
| {% macro render_pagination(pagination, endpoint, per_page, order_by, direction) %} | |
| <ul class="pagination"> | |
| {% if pagination.has_prev %} | |
| <li> | |
| <a href="{{ url_for(endpoint, page=pagination.prev_num, per_page=per_page, order_by=order_by, direction=direction) }}" aria-label="Previous"> | |
| <span aria-hidden="true">«</span> | |
| </a> | |
| </li> |
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
| stumble_around = "You stumble around and fall in a knife. Good job!" | |
| def start_room(): | |
| print "You enter a dark room with two doors. Do you go through door #1 or #2?" | |
| door = raw_input("> ") | |
| if door == "1": | |
| bear_room() | |
| elif door == "2": | |
| pit_fall() | |
| else: | |
| print stumble_around |
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 almostSorted(arr): | |
| s = sorted(arr) | |
| diffcount = 0 | |
| diff1 = None | |
| diff2 = None | |
| for i in range(len(arr)): |
OlderNewer