>>> from hello import app
>>> from flask import current_app
>>> app_ctx = app.app_context()
>>> app_ctx.push()
>>> current_app.name
>>> app_ctx.pop()
The command $ ls -l
, for example, can return a list of the type
total 24
drwxrwxr-x 2 diego diego 4096 feb 2 11:16 logs
drwxrwxr-x 2 diego diego 4096 feb 5 13:42 __pycache__
-rw-rw-r-- 1 diego diego 185 feb 5 13:40 app.py
drwxrwxr-x 2 diego diego 4096 feb 5 13:34 templates
drwxrwxr-x 6 diego diego 4096 feb 2 10:55 venv
-rw-rw-r-- 1 diego diego 64 feb 5 13:41 wsgi.py
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
<div id="container" data-stuff="my variable"> | |
<!-- This element's contents will be replaced with your component. --> | |
</div> | |
<script> | |
window.test = "my react test"; | |
window.dumbname = "martin" | |
// notice that `stuff` is not passed directly, it is passed using `data-stuff="my variable"` through `container.dataset` | |
</script> |
ngrok allows for rapid tunneling, exposing local servers behind NATs and firewalls to the public internet over secure tunnels. More information in https://ngrok.com/
ngrok 1.x is unmaintained and its usage is not encouraged. Instead, follow the instructions on https://ngrok.com/download
- download the zip file. In my case is for ubuntu_64 16.04
$ tail -n 10 -f outputfile | xargs -IL date +"%Y%m%d_%H%M%S:L"
Using ccze
$ (tail -n 10 -f outputfile | xargs -IL date +"%Y%m%d_%H%M%S:L") | ccze
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
set nocompatible " required | |
filetype off " required | |
"allow for external clipboard buffers | |
set clipboard=unnamed | |
" set numbers on | |
set nu | |
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_sqlalchemy import make_url | |
from urllib.parse import quote_plus | |
def build_connection_string(**params): | |
""" | |
Return the url for MSSQL Azure DB Instances | |
""" | |
connection_string = quote_plus( | |
("DRIVER={driver};" |
OlderNewer