Сервис собирает логи изменений разных библиотек и представляет их в едином виде
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
| Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) | |
| [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> import this | |
| The Zen of Python, by Tim Peters | |
| Beautiful is better than ugly. | |
| Explicit is better than implicit. | |
| Simple is better than complex. | |
| Complex is better than complicated. |
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 | |
| # How to reproduce: | |
| # * Get a python2.6 (you can use pythonbrew, for example). | |
| # * virtualenv --python=python2.6 env | |
| # * env/bin/pip install -e 'git+git://github.com/erikrose/nose-progressive.git#egg=nose-progressive' | |
| # * env/bin/nosetests --with-progressive tests.py | |
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
| TESTS> (defparameter *db* (make-instance 'mongo:database :name "pizzbook")) | |
| *DB* | |
| TESTS> (defparameter *test-collection* (mongo:collection *db* "the-test")) | |
| *TEST-COLLECTION* | |
| TESTS> (mongo:insert-op *test-collection* (son "_id" "blah" "other" "field")) | |
| ; No value | |
| TESTS> (mongo:insert-op *test-collection* (son "_id" "blah" "other" "another value")) | |
| ; No value |
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
| class SentryOutput(outputs.Output): | |
| def __init__(self, dsn, *args, **kwargs): | |
| self.client = Client(dsn=dsn) | |
| super(SentryOutput, self).__init__(format=λ msg: msg) | |
| def _open(self): | |
| pass | |
| def _close(self): | |
| pass |
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
| for theme in $(ls --color=never ~/pelican-themes/) | |
| do | |
| echo "Trying $theme" | |
| pelican content \ | |
| -o output \ | |
| -s pelicanconf.py \ | |
| -t ~/pelican-themes/${theme} | |
| read -p "Press Enter to continue..." | |
| done |
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 contextlib import contextmanager | |
| @contextmanager | |
| def cd(path): | |
| """Usage: | |
| with cd(to_some_dir): | |
| envoy.run('task do') | |
| """ | |
| old_path = os.getcwd() |
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
| (loop for i from 1 to 100 | |
| as 3-divable = (zerop (mod i 3)) | |
| as 5-divable = (zerop (mod i 5)) | |
| as both-divable = (and 3-divable 5-divable) | |
| when both-divable collect :FizzBuzz | |
| else when 3-divable collect :Fizz | |
| else when 5-divable collect :Buzz | |
| else collect i) |
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 | |
| # Quick and dirty demonstration of CVE-2014-0160 by | |
| # Jared Stafford ([email protected]) | |
| # Modified so that it finds cookies | |
| import sys | |
| import struct | |
| import socket | |
| import time | |
| import select |
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
| class CachedMixin(object): | |
| def get(self, *args, **kwargs): | |
| cache_key, cache_ttl = self.get_cache_params(*args, **kwargs) | |
| response = cache.get(cache_key) | |
| if response is None: | |
| response = super(CachedMixin, self).get(*args, **kwargs) | |
| response.render() | |
| cache.set(cache_key, response, cache_ttl) | |
| return response |