Skip to content

Instantly share code, notes, and snippets.

View signalpillar's full-sized avatar

Volodymyr Vitvitskyi signalpillar

View GitHub Profile
@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 [
[
(import [collections [defaultdict]]
[itertools [starmap]]
[codecs [open]]
[sys [argv]]
[pprint [pprint]]
[functools [partial :as Fn]])
(def DELIMITERS u",.;:!?")
(defn parse-words [line]
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
@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
from __future__ import print_function
# std
from collections import defaultdict
import random
import time
# 3rd-party
from blessed import Terminal
# 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 =(
# 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
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": []
}
"""
Script with :func:`build_hierarchy` function as an entry point.
Specify the class and get its inheritance hierarchy.
See also :mod:`inspect.getclasstree` as an alternative implementation.
There is also a way to convert hierarchy to the dot-language graph - :func:`node_to_dot_graph`
"""
(global-set-key (kbd "C-c m g")
(lambda () (interactive)
(setq current-prefix-arg '("def[[:space:]]\|class[[:space:]]"))
(helm-call-interactively 'helm-occur )))