Storing an array in a cookie using a serialized value can be a bit tricky. Problem lies in magic_quotes_gpc, in PHP 5.4 that was removed. When using set_cookie the quotes are being escaped.
More
July 20th, 2012
Everything you need to need about jQuery selectors
2 Comments, jQuery, by Joakim Ling.
jQuery offers a very powerful range of tools to select elements. These are influenced from CSS and some created of their own.
More
Sudo is a way to give users administrative rights, without giving them the root password. Very useful in a large environment where you a a mix of workstations and servers.
More
HTML5 introduced many new features, one of them is the placeholder attribute. What it does is showing text in a field until any value is entered, then hides the text. Very useful to show users example of what to enter in a field. You’ve probably seen this techinque a lot with Javascript, but native HTML5 support is even better.
More
May 23rd, 2012
How to get post ID in content_save_pre on a XMLRPC call
No Comments, Wordpress, by Joakim Ling.
If you are using the hook ‘content_save_pre’ and want to save custom values from an XMLRPC call, you have to do a cleaver little workaround. The problem is that the ID is generated when the call is executed which is after this hook.
More
Had a problem with a cloud server a while ago with updating subversion. This is a kernel error and I found out that its the random pool thats not working correctly. Here is a simple way how to recreate it.
More
March 27th, 2012
Get all posts on custom taxonomy slug with get_posts
No Comments, Wordpress, by Joakim Ling.
Custom post type is a great way to customize your WordPress and adding new taxonomies makes it even more powerful. All functionality comes with WordPress core but it can be difficult to specific posts on a custom taxonomy. The key in this is the new tax_query argument.
More
March 15th, 2012
Passing an argument to setTimeout() in Javascript
No Comments, Javascript, by Joakim Ling.
I came across a bit of complication when I for the first time needed to pass parameter to a function with setTimeout. The setTimeout() method calls a function or evaluates an expression after a specified number of milliseconds. It’s also supported in most browsers, brilliant tool if you want to create a javascript ticker.
More
March 5th, 2012
Find path of a class name in PHP with ReflectionClass
No Comments, PHP, by Joakim Ling.
To find out where a class is defined could be quite difficult is you are using frameworks you are not so familiar with. The ReflectionClass is a great tool to find out everything about your class and turn into objects.
More
All of your services have disk storage space allocated to you. When you fill your disk storage space, you will receive a notification message “Disk quota exceeded” when you try to perform operations, such as storing cache files or sending email. Even if you have free space left on your disk, doesn’t say that you have space to add new files.
More