Skip to content

Instantly share code, notes, and snippets.

View aruseni's full-sized avatar
🟢
Lead Python Software Engineer

aruseni

🟢
Lead Python Software Engineer
View GitHub Profile
# -*- coding: utf-8 -*-
def transliterate(string):
capital_letters = {u'А': u'A',
u'Б': u'B',
u'В': u'V',
u'Г': u'G',
u'Д': u'D',
u'Е': u'E',
# -*- coding: utf-8 -*-
import re
def transliterate(string):
capital_letters = {u'А': u'A',
u'Б': u'B',
u'В': u'V',
u'Г': u'G',
# -*- coding: utf-8 -*-
import re
def transliterate(string):
capital_letters = {u'А': u'A',
u'Б': u'B',
u'В': u'V',
u'Г': u'G',
# -*- coding: utf-8 -*-
def transliterate(string):
capital_letters = {u'А': u'A',
u'Б': u'B',
u'В': u'V',
u'Г': u'G',
u'Д': u'D',
u'Е': u'E',
# -*- coding: utf-8 -*-
import re
def transliterate(string):
capital_letters = {u'А': u'A',
u'Б': u'B',
u'В': u'V',
u'Г': u'G',
@aruseni
aruseni / starttornadoapp.py
Created November 22, 2012 22:28
backgrounddating.com starttornadoapp management command. This source code is licensed under the terms of the GNU GPL 3.0.
import signal
import time
import tornado.httpserver
import tornado.ioloop
from django.core.management.base import BaseCommand, CommandError
from privatemessages.tornadoapp import application
@aruseni
aruseni / tornadoapp.py
Created November 22, 2012 22:35
backgrounddating.com tornado chat. This source code is licensed under the terms of the GNU GPL 3.0.
import os
import datetime
import json
import time
import urllib
import brukva
import tornado.httpserver
import tornado.web
import tornado.websocket
These strings are not present in any other template or Python file, so you just put them here in order to make the makemessages management command keep them in the translation file.
{% load i18n %}
{% trans "Some string you want to keep in the django.po translation file" %}
{% trans "So makemessages won't comment it out each time you run it" %}
{% trans "This template does not have to be used anywhere, putting it in your templates directory is enough" %}
"""
We have walls of different heights represented
with the following array: [2,5,1,2,3,4,7,7,6].
The value at each index is the height of the wall.
Now imagine it rains. How much water is going
to be accumulated in puddles between walls?
We count volume in square blocks of 1X1.