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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Upload File using jQuery.ajax() with progress support</title> | |
| </head> | |
| <body> | |
| <input type="file" name="file" id="sel-file"/> |
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
| apt -y update | |
| apt -y upgrade | |
| apt -y install build-essential | |
| apt -y install git | |
| apt -y install wget | |
| apt-get --no-install-recommends -yqq install \ | |
| bash-completion \ | |
| build-essential \ | |
| cmake \ |
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
| # Reason for choosing cherrypy | |
| # https://blog.appdynamics.com/engineering/a-performance-analysis-of-python-wsgi-servers-part-2/ | |
| # | |
| # Flask application based on Quickstart | |
| # http://flask.pocoo.org/docs/0.12/quickstart/ | |
| # | |
| # CherryPy documentation for this | |
| # http://docs.cherrypy.org/en/latest/deploy.html#wsgi-servers | |
| # http://docs.cherrypy.org/en/latest/advanced.html#host-a-foreign-wsgi-application-in-cherrypy | |
| # Install: pip install cherrypy |
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
| import cherrypy | |
| cherrypy.config.update({'server.socket_host': '0.0.0.0', | |
| 'server.socket_port': 8080, | |
| }) | |
| class HelloWorld(object): | |
| def index(self): | |
| return "Hello World!" | |
| index.exposed = True |
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
| import socket | |
| import re | |
| import sys | |
| def check_server(address, port): | |
| # Create a TCP socket | |
| s = socket.socket() | |
| print "Attempting to connect to %s on port %s" % (address, port) | |
| try: | |
| s.settimeout(1) |
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
| from PySide import QtCore, QtGui, QtWebKit | |
| import sys | |
| app = QtGui.QApplication(sys.argv) | |
| testWindow = QtGui.QMainWindow() | |
| testWindow.show() | |
| app.setActiveWindow(testWindow) | |
| app.exec_() |
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
| import os, sys | |
| import Image | |
| im = Image.open(dir + '/' + filename) | |
| box = (16, 123, 960-24, 720-197) | |
| region = im.crop(box) | |
| region.save('cropped/' + filename.lower(), "png") |
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
| #!/usr/bin/env python | |
| #-*- coding:utf-8 -*- | |
| # hellowebkit.py | |
| # Copyright 2009 Piotr Maliński, riklaunim@gmail.com | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # This file is part of the PySide project. | |
| # | |
| # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | |
| # | |
| # Contact: PySide team <contact@pyside.org> | |
| # | |
| # This program is free software; you can redistribute it and/or |
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
| #!/usr/bin/env python3 | |
| import os | |
| for root, directories, filenames in os.walk('/tmp/'): | |
| for directories in directories: | |
| print(os.path.join(root,directories)) |