Skip to content

Instantly share code, notes, and snippets.

View imankulov's full-sized avatar

Roman Imankulov imankulov

View GitHub Profile
@imankulov
imankulov / watchmedo.sh
Created March 26, 2013 19:37
One-liner. Auto-building Sphinx docs with watchdog. Forked from http://jacobian.org/writing/auto-building-sphinx/
# pip install watchdog
exec watchmedo shell-command --patterns='*.rst;*.py' --ignore-pattern='_build/*' --recursive --command='make html' --wait
@imankulov
imankulov / urlunquote.py
Created April 28, 2013 19:36
urlunquote sample
import urllib
urls = [
'http://ru.wikipedia.org/wiki/%D0%91%D0%B5%D0%B4%D1%83%D0%B8%D0%BD%D1%8B',
'http://ru.wikipedia.org/wiki/%C1%E5%E4%F3%E8%ED%FB',
]
def urlunquote(url, guess_charsets=None):
if guess_charsets is None:
guess_charsets = ['utf-8', 'cp1251']
@imankulov
imankulov / db_test.py
Created June 24, 2013 12:44
Performance test for MySQL UPDATE
# -*- coding: utf-8 -*-
"""
Performance test for different types of update
Results sample
-----------------------------------------------
In [1]: import db_test
@imankulov
imankulov / watcher.py
Created November 9, 2013 18:40
Watchers. When something goes wrong, and only restart helps.
#!/usr/bin/env python
import argparse
import shlex
import subprocess
import time
def get_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--period', type=int, default=30)
@imankulov
imankulov / test_pool.py
Created June 10, 2014 08:57
Test generator and releaser which know how to create fixtures in separate threads
"""
Generator and Releaser objects which could be used to create and destroy
objects in separate threads. Generator constantly keeps the pool of N objects
to use by the test function (by default N equals to 1).
How to use them:
You create a session-scope generator and releaser. They are subclasses
of threading.Thread, so you should start them as well.
@imankulov
imankulov / the flow™.txt
Created October 17, 2014 14:12
the flow™
* __project notes__
[[NOTE]]: - We use colors (priorities) to mark the complexity of the task - It's okay to change the complexity on the task, as you work on it - We use a flow where tasks "bubble up" from the backlog to done - Depending on the project, you may have more (or less, without "testing", for instance) stages of the flow - One may or may not use tags
...Trivial. It's barely worth creating a separate item
...Easy. No hidden pitfalls, straightforward execution flow, short time to work [[priority 3]]
...Hard. Challenging. Pitfalls expected. Or just long and boring [[priority 2]]
...Super-hard. But you're not scared. Subtasks required [[priority 1]]
* !!Done!!
[[NOTE]]: Move all completed tasks here. They pass the testing phase and are in production, or ready to production. Tasks have to be stricken through
...Trivial task @feature
...Serious bug [[priority 2]]
@imankulov
imankulov / p12_to_pem.py
Last active August 29, 2015 14:07
Convert PKCS#12 certificate and key files to PEM
#!/usr/bin/env python
"""
Quick, dirty and insecure tool to extract certificate info and private key
from the PKCS#12 certicate and dump it to separate files in PEM format
(because openssl command-line tool is a mess)
Usage: p12_to_pem path/to/file.p12 password
"""
import os
@imankulov
imankulov / dictify.py
Created February 18, 2015 18:01
dictify.py -- extract "__dict__" contents from all objects recursively, and build a tree of them.
import json
def dictify(obj):
"""
Recursively find all dicts in a stricture, and convert them to attr dict
"""
if isinstance(obj, (list, tuple, set)):
return obj.__class__([dictify(item) for item in obj])
if isinstance(obj, dict):
@imankulov
imankulov / text.md
Last active December 14, 2020 15:38

Overview of localization tools.

I have collected a large number of proposals from Artyom, Roman, Nuno, Goncalo, selected 8 of them in my opinion the most successful platforms and checked how well they fit us.

I checked which of service fit us on the basis of features reviews from Goncalo, Nuno, and Roman, and tested following features:

  • Format support - localization formats which we can upload / download to / from service
  • Quality checks - checks on the correctness of the translation
  • Prulals - supports multiple forms and checks their spelling
  • Glossary - helps to standardize the way terms in your project are translated
@imankulov
imankulov / text.md
Last active December 14, 2020 15:38

Overview of localization tools.

I have collected a large number of proposals from Artyom, Roman, Nuno, Goncalo, selected 8 of them in my opinion the most successful platforms and checked how well they fit us.

I checked which of service fit us on the basis of features reviews from Goncalo, Nuno, and Roman, and tested following features:

  • Format support - localization formats which we can upload / download to / from service
  • Integrate with - Parameter indicates that the service is integrated with the app store. Since Nuno reported problems that changing in the localization files have to wait long for a confirmation.
  • Quality checks - checks on the correctness of the translation
  • Prulals - supports multiple forms and checks their spelling