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
| machine: | |
| python: | |
| version: 3.5.2 | |
| post: | |
| - pyenv global 2.7.10 3.5.2 | |
| dependencies: | |
| override: | |
| - pip install -r requirements.txt | |
| cache_directories: |
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
| # -*- coding: utf-8 -*- | |
| from app.services.mongo import mdb | |
| from flask import Blueprint | |
| blueprint = Blueprint("module_a", __name__, url_prefix="/module_a") | |
| @blueprint.route("/abc") | |
| def something(): | |
| # do something with mdb |
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
| def a(param): | |
| # do sth with param | |
| pass | |
| def b(coll): | |
| for i in coll: | |
| a(i) | |
| def sample_test(): | |
| data = [1, 2, 3, 4] |
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
| [defaults] | |
| inventory = production | |
| [ssh_connection] | |
| pipelining=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
| deploy:: | |
| ansible-playbook -i production deploy.yml -v |
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
| # -*- coding: utf-8 -*- | |
| import csv | |
| from selenium.webdriver import Firefox | |
| def get_driver(): | |
| driver = Firefox() | |
| return driver |
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
| # -*- coding: utf-8 -*- | |
| from selenium.webdriver import Firefox | |
| from selenium.webdriver.support.select import Select | |
| def get_driver(): | |
| # create driver instance | |
| driver = Firefox() | |
| return driver |
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
| # -*- coding: utf-8 -*- | |
| from requests import Session | |
| from bs4 import BeautifulSoup | |
| def main(username, password): | |
| login_url = "http://www.akcniceny.cz/muj-ucet/login/" | |
| my_account_url = "http://www.akcniceny.cz/muj-ucet/" | |
| post_data = { | |
| "persist" : 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
| # -*- coding: utf-8 -*- | |
| import csv | |
| from urllib.parse import unquote | |
| import requests | |
| from bs4 import BeautifulSoup | |
| def get_content_url(base_url): | |
| content = requests.get(base_url).content | |
| soup = BeautifulSoup(content, "html.parser") |
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
| <?php | |
| /** | |
| * loads (call require_once on) all php files in given directory | |
| * @param string $dir valid directory path | |
| */ | |
| function load_dir($dir){ | |
| foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)) as $file) { | |
| if ($file->getExtension() === "php") { | |
| require_once($file->getPathName()); |