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 main(): | |
app = make_app() | |
return app | |
app = main() | |
if __name__ == '__main__': | |
print("starting tornado server..........") | |
app.listen(tornado.options.options.port) | |
tornado.ioloop.IOLoop.current().start() |
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
tornado==6.1.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
fun isOnline(context: Context): Boolean { | |
val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
val n = cm.activeNetwork | |
if (n != null) { | |
val nc = cm.getNetworkCapabilities(n) | |
//It will check for both wifi and cellular network | |
return nc!!.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) || nc.hasTransport( | |
NetworkCapabilities.TRANSPORT_WIFI) |
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 os | |
import json | |
import datetime | |
import psycopg2 | |
import psycopg2.extras | |
from psycopg2.extras import Json | |
import tornado.httpserver | |
import tornado.options | |
import tornado.ioloop | |
import tornado.web |
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
# Define web app | |
# (The only routes that contain "." should be static files, the "." is neccessary for the extension | |
# dont make new, non-static routes containing "." or else the static file handler will attempt to handle the request) | |
application = tornado.web.Application([ | |
(r"/", StatusHandler), | |
], **settings) | |
application.listen(80) | |
http_server = tornado.httpserver.HTTPServer( | |
application, |
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
""" | |
Overriding the prepare method of the RequestHandler to redirect based on protocol | |
""" | |
def prepare(self): | |
if self.request.protocol == 'http': | |
self.redirect('https://' + self.request.host, permanent=False) |
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 concurrent.futures | |
import functools | |
from threading import get_ident | |
from tornado.gen import convert_yielded | |
from tornado.ioloop import IOLoop, _Selectable | |
import asyncio |
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 CTreeCtrlX : public CTreeCtrl | |
{ | |
protected: | |
HTREEITEM m_hItemFirstSel; // Init to NULL in constructor | |
DWORD m_dwDragStart; | |
void ClearSelection(); | |
BOOL SelectItems(HTREEITEM hItemFrom, HTREEITEM hItemTo); | |
HTREEITEM GetFirstSelectedItem(); |
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
#include "mfc_multi_select_ctree_ctr.h" | |
BEGIN_MESSAGE_MAP(CTreeCtrlX, CTreeCtrl) | |
ON_WM_LBUTTONDOWN() | |
ON_WM_KEYDOWN() | |
END_MESSAGE_MAP() | |
void CTreeCtrlX::OnLButtonDown(UINT nFlags, CPoint point) | |
{ | |
// Set focus to control if key strokes are needed. |
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
rm -rf "${bamboo.local_repo_name}" | |
echo "Deleted existing ${bamboo.local_repo_name}" | |
echo "Pulling git.collab repo" | |
git clone https://${bamboo.collab_usr}:${bamboo.collab_tap}@git.mycompany.com/scm/myproject/azure-server.git | |
echo "Moving into local repo" | |
cd "${bamboo.local_repo_name}" | |
echo "Switching to Azure local git" |
OlderNewer