Category Archives: Programming

Half-baked code snippets and everything related to programming.

Django: add i18n template tag to built-ins

Django 1.9 allows you to load template tags globally, i.e. without having to include {% load %} statements at the top of each template. The new option is called builtins and you can set it in your settings.py like so … Continue reading

Posted in Programming | Tagged | Leave a comment

Magnific Popup + HTML5 History API (demo)

A demo of Magnific Popup with unique URLs and browser Back/Forward button support, using HTML5 History API via History.js. GitHub.

Posted in Programming | Tagged | Leave a comment

Watermark images like a pro using Python + Wand + librsvg

This is a Python 2.7 code recipe for applying a semi-transparent vector (SVG) watermark with overlay blending like so: What’s special about it:

Posted in Programming | Tagged , | 4 Comments

Using Python’s urllib2 or Requests with a SOCKS5 proxy

Just a Python 2.7 code sample showing how to make requests using Python’s urllib2 or Requests through a SOCKS proxy.

Posted in Programming | Tagged | 3 Comments

Относительная дата по-русски в Python и Django

Под “относительной датой” я подразумеваю вывод даты следующим образом: 5 минут назад, вчера, 7 дней назад, завтра и т.д. (Не уверен, что это правильный термин, но ничего лучше в голову не приходит).

Posted in Programming, Посты на русском | Tagged , , | Leave a comment

ExtJs 4: password validation + random password button

This one is simple.

Posted in Programming | Tagged , | 1 Comment

ExtJs 4: dealing with messages (and errors) from an Ajax or REST proxy

When sending Ajax or REST requests, a proxy of ExtJs 4 typically expects a response with the following parameters: data, success and message. The message parameter is optional, but it may come in handy when you want to show the … Continue reading

Posted in Programming | Tagged , | 7 Comments

ExtJs 4: submit form on enter

It’s a shame that such a powerful framework as ExtJs 4 does not have this feature built-in.

Posted in Programming | Tagged , | 7 Comments

Demo of Highslide gallery with Ajax URLs

Update: a pure Javascript implementation by setnicka. Highslide is an excellent JavaScript library for making galleries, but there’s one feature I was really missing in it: Ajax URLs or URLs which change as you browse images on the page. Thankfully developers … Continue reading

Posted in Programming, Releases | Tagged , | Leave a comment

AppleScript to mount/unmount a drive

On my Mac Pro I have two internal hard drives I rarely use. Some times they “sleep” and while doing so, every file opening dialog, search in Spotlight or search in Dictionary might wake them up and that takes some … Continue reading

Posted in Programming, Releases | Tagged , , | 44 Comments