This file contains 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 Queue { | |
constructor() { | |
this.queue = []; | |
this.readLock = new Lock(); | |
this.writeLock = new Lock(); | |
this.setEmpty(); | |
} |
This file contains 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 bash | |
ENV_PATH="$(dirname "$(dirname "$(which pip)")")" | |
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)" | |
BAD_ENV_PATHS="/usr/local" | |
echo "Ensure the root of the broken virtualenv:" | |
echo " $ENV_PATH" |
This file contains 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 track_field_changes(only=None, exclude=()): | |
""" | |
Django models decorator for tracking fields changes | |
:only: fields to track for changes (all otherwise) | |
:exclude: fields to exclude from tracking | |
Adds to model instance: | |
get_old_value(field_name) — old value of given field | |
is_changed(field_name=None) — is any field (or given field) is changed |