Skip to content

Instantly share code, notes, and snippets.

View shalakhin's full-sized avatar
🤖
Get Shit Done

Olexandr Shalakhin shalakhin

🤖
Get Shit Done
View GitHub Profile
class Countly(object):
"""Countly API: http://resources.count.ly/reference#ousersall
"""
def __init__(self, username, password, *args, **kwargs):
self.base_url = kwargs.get('BASE', 'https://try.count.ly/')
self.requests = Requests(username, password, base_url=self.base_url)
def apps_all(self):
return self.requests.get('o/apps/all')
@shalakhin
shalakhin / gist:b0673a6e30e76e2a8e27
Created November 17, 2014 10:12
elasticsearch default config
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,
@shalakhin
shalakhin / errors.go
Last active August 29, 2015 13:57
using raven-go properly
// trace generates raven traceback
func trace() *raven.Stacktrace {
return raven.NewStacktrace(0, 3, []string{"myproject"})
}
// HandleError handles error like logging, mail notification.
func HandleError(err error) {
packet := &raven.Packet{Message: err.Error(), Interfaces: []raven.Interface{raven.NewException(err, trace())}}
// here we use Sentry instance created once in config instead of instantiating it every time
config.Config.Sentry.Client.Capture(packet, nil)
@shalakhin
shalakhin / Dockerfile
Created February 10, 2014 15:57
Dockerfile to create own docker-registry image
# VERSION 0.1
# DOCKER-VERSION 0.8
# AUTHOR: Olexandr Shalakhin <olexandr@shalakhin.com>
# DESCRIPTION: Image with docker-registry project and dependecies
# TO_BUILD: docker build -rm -t registry .
# TO_RUN: docker run -p 5000:5000 registry
# Changes:
# - use ubuntu 13.10
# - install pip/setuptools via apt-get
@shalakhin
shalakhin / prepare-commit-msg
Last active December 10, 2015 16:38
prepare-commit-msg git hook
#!/usr/bin/env python
# requirements: GitPython
# version 0.1
import git
import os
import sys
digraph G {
overlap=false;
size="20.99,29.71";
/* Entities */
/* Planning and Monitoring */
plan_ba_approach[label="Планування підходу \n бізнес-аналізу", shape=box];
conduct_stakeholders_analysis[label="Проведення аналізу \n зацікавлених сторін", shape=box];
plan_ba_activities[label="Планування заходів \n бізнес-аналізу", shape=box];
plan_ba_communication[label="Планування комунікації \n в бізнес-аналізі", shape=box];
plan_ba_req_management_process[label="Планування процесу \n управління вимогами", shape=box];
@shalakhin
shalakhin / Simple WoW bot
Created October 8, 2012 19:06
Bot prevents character to be dropped out for inactivity sending keyboard "SPACE" command in a random intervals
# -*- coding: utf-8 -*-
from time import sleep
from random import randrange
try:
import win32api
import win32con
import win32gui
except Exception, e:
print(e)
@shalakhin
shalakhin / hack.sh
Created March 31, 2012 12:38 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#