Skip to content

Instantly share code, notes, and snippets.

View uruz's full-sized avatar

Alexey Boriskin uruz

View GitHub Profile
+---------------[RSA 16384]--------------+
|........................................|
|...*................................*...|
|...+oo*..........................*oo+...|
|....*oXo*......................*oXo*....|
|...*oXXXXo*..................*oXXXXo*...|
|.*oXX+*+*oXo*..............*oXo*+*+XXo*.|
|*XXXX+***oXXXo+..........+oXXXo***+XXXX*|
|..++*+XXoXo*.+oo*......*oo+.*oXoXX+*++..|
|....+XXXo*.....+XXo..oXX+.....*oXXX+....|
@uruz
uruz / parser.py
Last active September 3, 2015 11:29 — forked from zubchick/parser.py
parser for presentation
# coding: utf-8
import os
from datetime import datetime
from funcparserlib.parser import some, a, many, skip, forward_decl
from funcparserlib.lexer import make_tokenizer, Token
__classes = {}
/**********************
* superDrEvalBros.js *
**********************
*
* You're still here?! Well, Dr. Eval, let's see
* how well you can operate with one less dimension.
*
* Give up now. Unless you have a magic mushroom
* up your sleeve, it's all over.
*/
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/
@uruz
uruz / cowsays.sh
Created February 6, 2014 10:32
All cowsays
for f in ls /usr/local/Cellar/cowsay/3.03/share/cows/*; do filename=$(basename "$f"); filename="${filename%.*}"; echo $filename; cowsay -f $filename "hello"; done;
@uruz
uruz / gist:5178113
Last active December 15, 2015 01:09
Что значит слово creep?

Слово creep используется для чего-то страшного, сверхъестественного, вызывающего ужас. В то же время, используется и для снижения градуса ужаса описываемого предмета, чаще в качестве прилагательного - something is rather creepy. Действительно ли объект ужасен, или же слово используется в уничижительном, высмеивающем смысле, чащего всего определяется по контексту. Кроме того, слово имеет оттенок внезапности ужаса. Скажем, окружающая нас повседневная россия вполне может быть описана как страшная или пугающая, но она не может быть creep - мы её видим каждый день. Частенько creepy употребляют в том смысле, что описывается некая ситуация, весь ужас которой, с одной стороны, сразу перед наблюдателем, а с другой стороны, смысл его до наблюдателя доходит не сразу. Классический пример: creep

@uruz
uruz / gist:4605085
Last active December 11, 2015 13:08
Hack to prevent _proxy__kw hack. Not sure it is better though.
diff --git a/django/utils/translation/__init__.py b/django/utils/translation/__init__.py
index f3cc634..d3c9200 100644
--- a/django/utils/translation/__init__.py
+++ b/django/utils/translation/__init__.py
@@ -80,11 +80,52 @@ def npgettext(context, singular, plural, number):
return _trans.npgettext(context, singular, plural, number)
gettext_lazy = lazy(gettext, str)
-ngettext_lazy = lazy(ngettext, str)
ugettext_lazy = lazy(ugettext, six.text_type)
@uruz
uruz / gist:4605065
Created January 23, 2013 12:35
Patch, which solves lazy() issues
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 661518e..9dcd325 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -1,9 +1,10 @@
+from django.utils import six
+from django.utils.decorators import available_attrs
+from functools import wraps, update_wrapper
import copy
import operator
@uruz
uruz / gist:4582334
Created January 20, 2013 22:46
django.utils.functional.lazy issues
diff --git a/tests/regressiontests/utils/functional.py b/tests/regressiontests/utils/functional.py
index 90a6f08..07d26af 100644
--- a/tests/regressiontests/utils/functional.py
+++ b/tests/regressiontests/utils/functional.py
@@ -1,5 +1,6 @@
from django.utils import unittest
from django.utils.functional import lazy, lazy_property
+from django.utils import six
@uruz
uruz / gist:4572992
Created January 19, 2013 14:36
Diff
diff --git a/taggit/managers.py b/taggit/managers.py
index 69d1cfe..6759a0a 100644
--- a/taggit/managers.py
+++ b/taggit/managers.py
@@ -16,6 +16,38 @@ except ImportError:
pass
+class JoiningObject(object):
+ def __init__(self, model, through, direct):