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
'http://www.utf8-chartable.de/unicode-utf8-table.pl?start=1024&utf8=-&unicodeinhtml=dec | |
'use numerical HTML column | |
Function Transliterate(Russian As String) | |
letters = Array("A", "B", "V", "G", "D", "E", "YO", "ZH", "Z", "I", "Y", "K", "L", "M", "N", "O", "P", "R", "S", "T", "U", "F", "H", "TZ", "CH", "SH", "SCH", "", "Y", "", "E", "YU", "YA", "a", "b", "v", "g", "d", "e", "yo", "zh", "z", "i", "y", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "f", "h", "tz", "ch", "sh", "sch", "", "y", "", "e", "yu", "ya", "#") | |
i = 1040 | |
For Each letter In letters | |
Dim val As String | |
Select Case letter | |
Case "YO" | |
val = ChrW(1025) |
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
"""SQLAlchemy Metadata and Session object""" | |
import datetime | |
import json | |
import time | |
from sqlalchemy import MetaData | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
__all__ = ['Session', 'metadata', 'Model', 'SchemaEncoder'] |
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
# pip install requests | |
import requests | |
import json | |
url_template = 'https://api.foursquare.com/v2/users/self/checkins?limit=250&oauth_token={}&v=20131026&offset={}' | |
# If you navigate to https://developer.foursquare.com/docs/explore, Foursquare | |
# will generate an OAuth token for you automatically. Cut and paste that token | |
# below. | |
token = "" |
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
from flask import make_response | |
from functools import wraps, update_wrapper | |
from datetime import datetime | |
def nocache(view): | |
@wraps(view) | |
def no_cache(*args, **kwargs): | |
response = make_response(view(*args, **kwargs)) | |
response.headers['Last-Modified'] = datetime.now() | |
response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0' |
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
from sqlalchemy import create_engine, event, orm | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.orm.session import Session as SessionBase, object_session | |
from sqlalchemy.event.api import listen | |
# The following adds delete, insert, and update events after successful commits. | |
# SQLAlchemy provides only events after flushes, but not after commits. | |
# The classes are adapted from Flask-SQLAlchemy. | |
# see also https://stackoverflow.com/a/12026787/60982 |
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
#!/usr/bin/env python | |
import os | |
import urllib.parse | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
# Configure Database URI: | |
params = urllib.parse.quote_plus("DRIVER={SQL Server};SERVER=sqlhost.database.windows.net;DATABASE=pythonSQL;UID=username@sqldb;PWD=password56789") |
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
# -*- coding: utf-8 -*- | |
""" | |
pg_uuid | |
~~~~~~~~~~~~~~~~ | |
<NO DESCRIPTION>. | |
:copyright: (c) 2018 by WRDLL <[email protected]> | |
""" | |
from flask import Flask |