Skip to content

Instantly share code, notes, and snippets.

View signalpillar's full-sized avatar

Volodymyr Vitvitskyi signalpillar

View GitHub Profile
def test_empty_recipients_result(datastore):
"""Ensure empty document returned when there is nothing in the storage"""
assert_json_response(
do_get(handler.RECIPIENTS_URL),
(
200,
{
"next_results_url": None,
"results": []
}
# initialize project (run when requirements.txt is changed)
# NOTE: doesn't work with SVN requirements ...
ifndef VIRTUAL_ENV
$(error Run this command in the virtualenvironment)
endif
init: deps run-gaenv mapreduce-deps rest-deps
mapreduce-deps:
mkdir $$VIRTUAL_ENV/ext || true
@signalpillar
signalpillar / Makefile
Last active August 15, 2018 15:41
Makefile used with fabric
FAB_COMMAND := fab -f tasks.py TASK \
-i ~/.ssh/XXX_id_rsa \
--user=<username>
reconfigure-ca-network:
$(FAB_COMMAND:%TASK=reconfigure_ca_networking:vm_name=vm)
restart-ca-service:
$(FAB_COMMAND:%TASK=restart_ca_service)
# It is very important to test negative test-cases also.
# If required to raise exception - strive to raise original type of the exception as
# they are not always initialized in the appropriate manner.
def test_failed_with_retryable_error(self):
"""Ensure that retry error raised in some predefined case"""
# given
sharing_violation_error_code = 0xC0000043
side_effects = [
# this kind of errors - do not initialize `message` field =(
from __future__ import print_function
# std
from collections import defaultdict
import random
import time
# 3rd-party
from blessed import Terminal
@signalpillar
signalpillar / 0_reuse_code.js
Created June 5, 2014 06:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
merge as one commit
# update develop
git fetch origin
git co develop
git rebase origin/develop
# be sure that you don't have conflicts
git co <feature-branch>
git merge develop
(import [collections [defaultdict]]
[itertools [starmap]]
[codecs [open]]
[sys [argv]]
[pprint [pprint]]
[functools [partial :as Fn]])
(def DELIMITERS u",.;:!?")
(defn parse-words [line]
@signalpillar
signalpillar / busywait.hy
Last active August 29, 2015 13:56
hy on cherrypy
; standard imports
(import random)
; 3rd-party imports
(import [cherrypy [config quickstart expose]])
(def choices [
[
@signalpillar
signalpillar / dev_with_git.md
Created October 7, 2013 13:06
Development with Git

Intro

The goal of this page is to suggest yet another one flow how to develop with Git. The goal of the flow itself is to make history more clearer and linear.

Flow

Given two branches develop and M42_feature_branch

We already did some development in the feature branch and even passed review. Next step is to merge changes into develop

git checkout develop