We love sharing our knowledge and experience
These are some of our thoughts on technology and business processes, as well as our inner workings and developer lifestyles.
- all
- Alexandr Selyanov
- Alexey Demianenko
- Anastasia Kryzhanovska
- Anna Ianushenko
- Anna Sydorenko
- Anton Kozachok
- Anton Lysenkov
- Denis Untevskiy
- Emma Khomits
- Igor Bolotnikov
- Igor Tokarev
- Kateryna Chegodaeva
- Maryna Sharapova
- Mikhail Andreev
- Mykola Korovenko
- Mykyta Miazin
- Nataliya Yaremenko
- Nikolay Budnikov
- Oksana Mirgorodskaya
- Oleksandr Lebid
- Oleksandr Oliinyk
- Pasha Volkov
- Rostyslav Stekh
- Viktor Tyshchenko
- Vlada Oliinyk
- Volodymyr Kalyuzhnyi
- Volodymyr Sydorenko
- Yurii Mironov
When we use css-sprites it's important to make browser cache them for longest period possible. On other hand, we need to refresh them when they are updated. This is especially visible when all icons are stored in single sprite. When it's outdated - entire site becomes ugly.
I've created this small sprite to create css sprites. It glues images from directory directory into single file and generates corresponding css.
In VIM there is a command for char search: f. After first use it can be repeated with ;. I like to navigate in line with it. You see that you need to go to bracket in a middle of a line - you press f( and one-two ; and you are there. There's no such command in Emacs, so I had to write my own. I've managed even to implement repetition with ;.
In order to check if user is authentcated in test, you can run:
Learn how to use "OR" and "AND" queries efficiently in Django without using database models Q. Enhance your query-building skills. Dive in now.
It appears that not everyone knows that in python you can create classes dynamically without metaclasses. I'll show an example of how to do it.So we've learned how to use custom QuerySet to chain requests:Article.objects.old().public()Now we need to make it work for related objects:user.articles.old().public()This is done using use_for_related_fields, but it needs a little trick.
As you know, model managers can be overriden in Django. It's convenient to add custom filtration method.
In my current project I had a task to use twitter API. Twitter uses OAuth for authentication, which is pretty dreary. To avoid fiddling with it all the time, I've moved authentication to decorator. If key is available - nothing happens, just view is launched as usual. It's convenient that there's no need for additional twitter settings in user profile. Code is in article.
