Quick tip: Draw border on the inside of an element using CSS

One way that you can draw a border on the inside of an HTML element rather than on the outside is to use the box-sizing CSS property. This is supported on Firefox, Chrome, Safari, Opera and IE8+. Read the full article ...

Really disable the cross site request forgery (csrf) middleware in Django

So I said “No problem, I’ll just remove the csrf middleware”. Apparently, this doesn’t cut it for the already built applications that come from Django, like the Auth application. Read the full article ...

Add your extension’s toolbar button to Firefox at first run

The problem that most of the extensions have, is to place the toolbar button on a toolbar by default, so the users will see it. The fix for this problem is that, at first run of your extension, it should place the button on a toolbar that Firefox has by default. Read the full article ...

Quick tip: Uninstall Xcode from your Mac

Apparently, just deleting the Developer folder won’t cut it. I found out that the correct way to uninstall Xcode is to run a command in the terminal. Read the full article ...

Custom JavaScript events

So, you want to trigger an event when something happens in you javascript code? There might be better ways to do it, but here is the solution that I use for my code which is pretty light and easy to understand. Read the full article ...

How to minify HTML output in Django

So, you want to compress the size of the HTML that Django generates? Here is the Django way to do it.

In order to do this, you’ll have to write a middleware for your application. Read the full article ...

Coding a giant under the microscope: Farbrausch

So, you think that some nice 3D graphics require so much space that it would come on a DVD or a CD ? You are almost right… I say almost because there are this guys in Germany who would try to tell you otherwise. They are called by the name Farbrausch and are well-known on the demoscene …scene. They write some astonishing 3D computer generated animations that occupy as less as 64 kilobytes. Read the full article ...

How to set a variable in Django template

So, you need for some reason to set a variable inside a Django template? As you may have figured by now, Django does not implement such a feature. That is, because the logic of setting the variable must go in the view, not in the template. But there are some rare cases when you actually need this. Read the full article ...

Quicktip: capture the output of a Django command

So, you want to programmatically call a Django command, and then capture it’s output? The documentation is very slim when it talks about how to call a Django command from code. To call a Django command from code it’s easy: just use call_command. To solve the trick of capturing the output of this I had to dig a little intro the Django source. Read the full article ...

Quick tip: how to refresh the favicon

So, you made a new favicon, you’ve replaced the old one with the new one on the server, and no matter what you do you still see the old favicon on the website ? Clearing the cache almost never works, so what do you do?

Actually, the solution is very easy: access the favicon directly with the browser (for example, go to www.example.com/favicon.ico) , refresh if necessary, then go… Read the full article ...

Next Page »