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> | |
| <head> | |
| <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
| <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> | |
| <style> | |
| body { padding: 0; margin: 0; } | |
| html, body, #map { height: 100%; } | |
| </style> | |
| </head> |
Project:
project/: A directory named with the project's name which stores the actual Python package__init__pyapp.pysettings.pyurls.pymodels/__init__.pybaes.py
handlers/
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
| // | |
| // QuadTreeNode.cpp | |
| // | |
| // Created by Tomas Basham on 15/03/2014. | |
| // Copyright (c) 2014 tomasbasham.co.uk. All rights reserved. | |
| // | |
| #include <iostream> | |
| #include "QuadTree.h" |
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
| #!/bin/bash | |
| # Select the modules to install with true/false | |
| INSTALL_AQUARIUS=false | |
| INSTALL_AVHHR=false | |
| INSTALL_CZCS=false | |
| INSTALL_GOCI=false | |
| INSTALL_HICO=false | |
| INSTALL_MERIS=false |
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
| # This is just a cheat sheet: | |
| # On production | |
| sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
| # On local | |
| scp -C production:~/database.sql.gz | |
| dropdb database && createdb database | |
| gunzip < database.sql.gz | psql database |
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 asyncio | |
| from contextlib import closing | |
| import aiohttp | |
| async def download_file(session: aiohttp.ClientSession, url: str): | |
| async with session.get(url) as response: | |
| assert response.status == 200 | |
| # For large files use response.content.read(chunk_size) instead. |
Windows Service with Python 3.5 and pyinstaller
- Python 3.5.x
- Visual C++ Build Tools 2015
- PyInstaller 3.2
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 | |
| __author__ = "github.com/ruxi" | |
| __license__ = "MIT" | |
| import requests | |
| import tqdm # progress bar | |
| import os.path | |
| def download_file(url, filename=False, verbose = False): | |
| """ | |
| Download file with progressbar | |
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
| const EventEmitter = require('events') | |
| class MyClass extends EventEmitter { | |
| constructor() { | |
| super() // required | |
| this.emit('event', 100) | |
| } | |
| } |