Skip to content

Instantly share code, notes, and snippets.

How soon we will travel again?

DmitrII Gerasimenko kidig

How soon we will travel again?
View GitHub Profile
kidig / gitlab.rb
Created Sep 25, 2018
Gitlab Yandex.OAuth Single Sign-On
View gitlab.rb
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['Yandex']
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_providers'] = [
"name" => "oauth2_generic",
"app_id" => "your-app-id",
"app_secret" => "your-app-secret",
"args" => {
client_options: {
View hosts
from zeep import Client
WSDL_URL = 'http://path-to-server?wsdl'
WS_USER = 'username'
WS_PASSWORD = 'password'
client = Client(WSDL_URL)
LogOn = client.bind('TeleoptiCccSdkService', 'TeleoptiCccLogOnService')
user = LogOn.LogOnAsApplicationUser(userName=WS_USER, password=WS_PASSWORD)
finish_statuses = ['finished', 'cancelled']
if self.status == self.STATUS_FINISHED:
if not self.event_type == self.TYPE_DELIVERY:
delivery =
if delivery and delivery.status not in [finish_statuses]:
raise ValidationError({'status': ['Please finish/cancel delivery event first.']})
# delivery.status = 'finished'
kidig /
Created Feb 8, 2017
PGN chess format parser
# Demonstration of the parsing module, implementing a pgn parser.#
# Originally by Alberto Santini
import sys
from pyparsing import Combine, Forward, Group, Literal, oneOf, OneOrMore, Optional, Suppress, ZeroOrMore, Word
from pyparsing import ParseException
from pyparsing import alphanums, nums, quotedString, removeQuotes

Keybase proof

I hereby claim:

  • I am kidig on github.
  • I am kidig ( on keybase.
  • I have a public key whose fingerprint is 0764 5193 EA4B AC2A 1475 5135 AA21 908A C83F FCB5

To claim this, I am signing this object:

#!/usr/bin/env python
# coding: utf-8
import re
import requests
from bottle import route, run, response
from bs4 import BeautifulSoup, Comment, Doctype
HOST = 'localhost'
kidig /
Last active Aug 29, 2015
Example for the python shovel.
from shovel import task
def hello(name):
print "Hello, %s!" % name
def kwargs(**kwargs):
print "Kwargs: %s" % kwargs
kidig /
Created Apr 4, 2014
Parse timetable from
def parse_schedule_page(content):
doc = lxml.html.document_fromstring(content)
rows = doc.xpath('//table[@class="reqform"]/tr/td')
print "Rows:", len(rows)
description = ''
if len(rows):
description = " ".join([line.text_content().strip() for line in rows[0].xpath('.//h3')])
View matching
# n) Something text or
# n) Right text*
match = re.match(r'^\w\)\s+(.[^\*]*)(\*?)$', line, re.UNICODE)
if match and len(match.groups()):
answer = dict(zip(['text','right'], [x for x in match.groups() if len(x)]))