by Arnold Daniels on 02/15/2013
I’m happy to say that many developers have found their way to Jasny Bootstrap. Especially the file upload component, is very popular. It can replace any normal <input type="file"> element to display a nice widget that is consistent across browsers and can show a preview for images.
This is just an image
The documentation shows the HTML to use, but it doesn’t show how to use it with existing files. I’ll explain it here.
Continue Reading »
by Arnold Daniels on 01/1/2013
I just read the very interesting article ‘How I Made a 26-Hour Day‘ by Andrew Dumont. As many I’m also struggling to get more out of a day. He has some very good ideas about how to achieve that.
The thing I didn’t like so much about it, was the statement that you have to become a morning person to be more productive. I’ve tried waking up early, but finding that it just wouldn’t work for me.
Much of my social life takes place in the evening and at night, like going out with friends, salsa dancing, etc. Having to go to bed early to keep my daily rhythm would mean I’d have to give up much of my social life. Let’s say I’d only go out on Friday and/or Saturday, going to bed around 2:30. I would struggle to get back into rhythm and feel almost jet-lagged.
Continue Reading »
by Arnold Daniels on 03/26/2012
Turning links like www.example.com and http://twitter.com into clickable links. Sounds like an easy task, right? We’ll there are a few problems that might arise, especially if the text is already HTML formatted.
This function first takes out all potential dangers, by extracting links and tags and replacing them with a placeholder. It than extracts all URLs and replaces them with a placeholder, storing the full HTML link. At the end it replaces all placeholders with the links and tags.
Continue Reading »
by Arnold Daniels on 05/11/2010
A backdoor provides access to an application bypassing the normal authentication process. There are many ways to do this. Some are more secure than others.
Why do you need a backdoor?
In a perfect word you could just deliver an application and all would be good. However in the real world there are unforeseen issues which need to be solved. This means that you as a developer will need access to the application. To reproduce the problem, you usually want to run the application logged in as the user that spotted the issue.
Another use of the backdoor is in a situation where you want to allow a user, that has already been authenticated, to bypassing further authentication. For example if you have a (web hosting) control panel where the user is already logged in, you can allow him to directly access the dashboard of the application without have to enter his password again. This requires a backdoor, since you don’t know his (unencrypted) password.
Continue Reading »
by Arnold Daniels on 11/26/2009
In the article ‘Versioning MySQL data‘, I showed the basics of implementing a revisioning system using trigger. As Jens Schauder already pointed out, often the data of a record is spread across multiple tables, like an invoice with multiple invoice lines. Having each invoice line versioned individually isn’t really useful. Instead we want a new revision of the whole invoice on each change.
Continue Reading »
by Arnold Daniels on 11/12/2009
As a developer you’re probably using a versioning control system, like subversion or git, to safeguard your data. Advantages of using a VCS are that you can walk to the individual changes for a document, see who made each change and revert back to specific revision if needed. These are features which would also be nice for data stored in a database. With the use of triggers we can implement versioning for data stored in a MySQL db.
Continue Reading »
by Arnold Daniels on 10/28/2009
In the article ‘An alternative way of EAV modelling’, I discussed how to do EAV modelling by casting all values (except text) to integers. I’ll continue on that and talk about more advanced topics like multi-value fields.
Continue Reading »
by Arnold Daniels on 09/26/2009
Officially PHP doesn’t support multiple inheritance. There are several ways around this, without having to duplicate code.
PHP 5.4 will support Traits. This concept is almost similar to mixins. For more information check the PHP manual.
Continue Reading »
by Arnold Daniels on 06/18/2009
Since a few months I’ve done away with using the Gnome main menu. Instead I use Gnome Do. I removed the bottom toolbar long ago, because always use alt-tab.
I’m not using the top toolbar much either. It was just taking up valuable screen space. I contains only the notification area and a logout button. I was looking at a way to remove it completely. The answer came in the Compiz widget layer. By placing it on the widget layer, fullsize windows actually fill the full screen, but the notification area is still available for applications who need it.
To move Gnome panel to the Widget layer, open ‘CompizConfig Settings Manager’ and enable ‘Widget Layer’. Go to tab ‘Behaviour’ and add the following text for the ‘Widget Windows’ field:
(class=Gnome-panel & type=Dock)
The desktop will now be completely clean:

With we can display the widget layer, where the panel is found:

PS. The widgets you see on the widget layer are screenlets. Ubuntu has the screenlets package in the universe repository.
by Arnold Daniels on 06/17/2009
I’ve seen a lot of methods used to take a website temporarily off-line for maintenance. Most involve a using PHP to disable the site or renaming the index file. There is however a far better method of doing this, by placing the following in the vhost file or in an .htaccess file in the document root:
Header always set Retry-After "Thu, 18 Jun 2009 08:00:00 +0200"
Redirect 503 /
This way you are sure no part of the site is used. Also by returning a 503 http response, search-engine crawlers will not reindex your site right at the moment it is down. You can use ‘ErrorDocument’ to place a different text than the apache default.