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
| """Comparison of fetching web pages sequentially vs. asynchronously | |
| Requirements: Python 3.5+, Requests, aiohttp, cchardet | |
| For a walkthrough see this blog post: | |
| http://mahugh.com/2017/05/23/http-requests-asyncio-aiohttp-vs-requests/ | |
| """ | |
| import asyncio | |
| from timeit import default_timer |
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/python3.6 | |
| # Алгоритм банкомата, используя левостороннее дерево. | |
| # Вариант без лимитов банкнот! | |
| class Node(list): | |
| # Левостороннее дерево | |
| _value = None | |
| _childrens = None |
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 logging | |
| class SomeSyntaxError(Exception): pass | |
| class SyntaxError(SomeSyntaxError): | |
| bracket = None | |
| idx = -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
| import logging | |
| class SomeSyntaxError(Exception): pass | |
| class SyntaxError(SomeSyntaxError): | |
| bracket = None | |
| idx = -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
| /* Without using express-promise-router... | |
| * If either of the two Promise-returning methods ends up failing (ie. rejecting), | |
| * an uncaught exception will be printed to stdout, and the client will never get | |
| * a response - instead, they'll be stuck on an infinitely loading page. | |
| */ | |
| express = require("express").router(); | |
| router.get("/", function(req, res) { | |
| Promise.try(function(){ |
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
| { "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
| { "keys": ["end"], "command": "move_to", "args": {"to": "eol"} } |
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
| hub: | |
| image: selenium/hub | |
| ports: | |
| - "127.0.0.1:4444:4444" | |
| chrome: | |
| image: selenium/node-chrome-debug | |
| links: [hub] | |
| external_links: | |
| - myapplication_frontend_1:pdftables |
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
| """ | |
| A TestRunner for use with the Python unit testing framework. It | |
| generates a tabular report to show the result at a glance. | |
| The simplest way to use this is to invoke its main method. E.g. | |
| import unittest | |
| import TestRunner | |
| ... define your tests ... |
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
| // Прочитать голосом интервью на сайте meduza.io | |
| // | |
| // Когда ты слишком ленив, что бы читать самому... | |
| // | |
| // Запуск: скопировать в консоль на стр интервью и запустить | |
| function _say_with_voice(text, voice) { | |
| var msg = new SpeechSynthesisUtterance(text); | |
| msg.voice = voice; |
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
| // Прочитать голосом интервью на сайте meduza.io | |
| // | |
| // Когда ты слишком ленив, что бы читать самому... | |
| // | |
| // Запуск: скопировать в консоль на стр интервью и запустить | |
| function _say_with_voice(text, voice) { | |
| var msg = new SpeechSynthesisUtterance(text); | |
| msg.voice = voice; |
NewerOlder