All articles

  1. Customize Default Pelican Theme

    I wanted to customize the default theme of Pelican but didn't want to copy single template files or to edit the files in the python path.

    In the docs you can find how you install, remove and list themes [1]

    pelican-themes -v -l

    You'll get some output like ...

  2. Python - Strip tags from a String

    This is a little snippet to remove tags from a string to get the only raw textual content. I'm using the Beautiful Soup Library [1] for this job.

    Install Beautifulsoup with pip:

    pip install beautifulsoup4


    from bs4 import BeautifulSoup
    html = "<html><body><h1 ...
  3. Django - Reversing admin URLs in Templates

    {% raw %}
    {% url admin:index %}
    {% url admin:polls_choice_add %}
    {% url admin:polls_choice_change %}
    # For Django 1.5. Thanks to Kenneth Love
    {% url 'admin:index' %}
    {% url 'admin:polls_choice_add' %}
    {% url 'admin:polls_choice_change' %}
    {% endraw %}

    With this Code Examples you can manage to get the right url in the templates where you want ...

  4. Reinstall GRUB2 with arch linux live cd / usb key

    So I had to reinstall my Windows 8 in my dual boot system with Arch Linux. After the reinstall I had the default boot manager of Windows back in place of GRUB2.

    My way to fix it, was to install on my USB key the current live CD of archlinux ...

  5. Git - Rename a git branch

    To rename a branch is very easy to need only the next command for it.

    (-m means “Move/rename a branch and the corresponding reflog.”)

        git branch -m old_branch_name new_branch_name
  6. Pycon 2012 - Stop Writing Classes

    Classes are great but they are also overused. This talk will describe examples of class overuse taken from real world code and refactor the unnecessary classes, exceptions, and modules out of them.


  7. Django - Pre-Validation with the URL dispatcher

    I work currently on a rating feature, to rate some items and I want to do this in one view to handle the methods POST and GET.

    POST should handle the submit request(rate count) of the item

    GET should handle the template with the right item to see the ...

Page 1 / 2 »