# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
This file contains 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 datetime | |
import time | |
from functools import wraps | |
from wsgiref.handlers import format_date_time | |
from flask import make_response | |
def cache(expires=None, round_to_minute=False): | |
""" | |
Add Flask cache response headers based on expires in seconds. |
This file contains 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 extract(d): | |
import inspect | |
inspect.getouterframes(inspect.currentframe())[1][0].f_locals.update(d) |
This file contains 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 WeatherTypes | |
{ | |
const NOT_AVAILABLE = 'NA'; | |
const CLEAR_NIGHT = 0; | |
const SUNNY_DAY = 1; | |
const PARTLY_CLOUDY_NIGHT = 2; | |
const PARTLY_CLOUDY_DAY = 3; | |
const NOT_USED = 4; | |
const MIST = 5; | |
const FOG = 6; |
NewerOlder