Skip to content

Instantly share code, notes, and snippets.

Pavlo Skliar skliarpawlo

Block or report user

Report or block skliarpawlo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View url-match.clj
;;
;; Matcher should recognize and destruct URL by:
;; host: domain
;; path: parts, splitted with "/"
;; queryparam: name/value pairs of query
;; (see examples below)
;;
;; Each string that is started from "?" is a "bind"
;; (recognize matcher) should return nil or seq of binds
;;
View bazel_spark.log
This file has been truncated, but you can view the full file.
============================= test session starts ==============================
platform darwin -- Python 3.5.2, pytest-3.2.3, py-1.7.0, pluggy-0.4.0 -- /usr/local/bin/python3.5
cachedir: ../.cache
rootdir: /private/var/tmp/_bazel_pavloskliar/4ebdf5e551906a3d6bd81a9029c30c48/execroot/__main__/bazel-out/darwin-fastbuild/bin/tool_castor/castor_integration_tests.runfiles/__main__, inifile: tox.ini
collecting ... INFO:dd.datadogpy:No agent or invalid configuration file found
collected 63 items
tests/integration/test_activities_merger.py::TestActivitiesMergerWorkflow::test_abort_with_corrupted_delta INFO:root:Starting the new global session for <class 'castor.TestCastorSession'>
Warning: Ignoring non-spark config property: es.nodes.wan.only=true
@skliarpawlo
skliarpawlo / emacs-docker-compose.yml
Last active Feb 6, 2018
use emacs docker compose
View emacs-docker-compose.yml
...
emacs:
build:
dockerfile: /Users/psk/dev/dotfiles/ide/Dockerfile
context: /Users/psk/dev/dotfiles/ide/
args:
- SUBDIR=tool-castor
environment:
- DISPLAY=$DISPLAY
- SUBDIR=tool-castor
View run_test_containers.sh
docker run --name mysql-test -e MYSQL_DATABASE='tube_test' -e MYSQL_USER='jenkins' -e MYSQL_PASSWORD='jenkins' -e MYSQL_ALLOW_EMPTY_PASSWORD='yes' -d mysql:5.5
docker run --name redis-test -d redis
docker run --name cassandra-test -m 500M --memory-reservation 100M --memory-swap 100M -e "MAX_HEAP_SIZE=300M" -e "HEAP_NEWSIZE=100M" -d cassandra
docker run --name rabbitmq-test -d rabbitmq:3.6.2-management
# docker rm $(docker ps -a -q)
# docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
# docker volume rm $(docker volume ls -qf dangling=true)
@skliarpawlo
skliarpawlo / tmuxify.sh
Last active Apr 19, 2016
run muliple equal commands under single tmux session
View tmuxify.sh
#!/bin/bash
# $1 - session name
# $2 - num of processes
# $3 - cmd
tmux new-session -s $1 -d
for i in `seq $2`
do
tmux select-pane -t $1.0
View activities_join.py
#!/usr/bin/env python3
import argparse
import os
from pyspark import SparkContext, SparkConf
from pyspark.sql import HiveContext
args_parser = argparse.ArgumentParser('YT Activities join')
args_parser.add_argument(
'--drain',
View str_generator.py
from itertools import product
def generate_from_pattern(pattern, open_sep='{{', close_sep='}}'):
""" Generates all possible variations that fits pattern.
For example:
>>> generate_from_pattern('number {{9-11}}')
['number 9', 'number 10', 'number 11']
>>> generate_from_pattern('number {{1-3,11}}')
View commit-msg
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import sys
EMO = os.environ.get('TUBULAR_COMMIT_EMOJI', '👮 ')
SHORT_DESCRIPTION_LINE_REGEX = re.compile('^((?:[A-Z]+-\d+)|FIX|HOTFIX|IMP) (.{1,50})$')
@skliarpawlo
skliarpawlo / parse_json_from_string.py
Created Jul 16, 2015
Parse json from piece of html/script
View parse_json_from_string.py
def _get_json_from_string(s):
"""Parses first found json object from string (piece of html).
>>> _get_json_from_string('{"a": "b"}')
{u'a': u'b'}
>>> _get_json_from_string('dskljasd{"a": "b"}asdkljasd')
{u'a': u'b'}
>>> _get_json_from_string('require(asd=[{"a": "b"}, {"c":"d"}]spamspamspam)')
[{u'a': u'b'}, {u'c': u'd'}]
>>> _get_json_from_string('{"a": [1,2,{"b":"d[1,2,3]sd"}]}')
@skliarpawlo
skliarpawlo / layout.py
Last active Aug 29, 2015
layout of items sequentially taking (slot types:item type) mapping into account
View layout.py
from blog.const import NEWS_TILE_TYPE
from catalog.const import PRODUCTS_TILE_TYPE, FEATURED_PRODUCTS_TILE_TYPE
from index.services.query import get_tiles_qs
PER_PAGE = 6
# list of layouts 'id's
LAYOUTS_PATTERN = [0, 3, 1]
# all tile type should be listed here, used for iterating
You can’t perform that action at this time.