JQuery delayed change event on input element

April 5th, 2011 No comments

Just a quick note today: when you need to catch change of input[type=text] you’ll probably not use the change event as it is fired in the same way as blur. So you’ll end up listening for keyup or keydown but not wanting to process each of those events. The solution is to use timeout and process the event only if not received in the specified amount of time.

The code to do that could look like the one below. Set the value 1000 to whatever you need and process the data instead of showing the alert.

$('input[type=text]').data('timeout', null).keyup(function(){
    clearTimeout($(this).data('timeout'));
    $(this).data('timeout', setTimeout(function(){
        alert('delayed alert');
    }, 1000));
});
Categories: Devel, Howto Tags: , ,

Use PHP and Twitter API to display your tweets

March 15th, 2011 No comments

I’ve modified my site to show last of my tweets in the sidebar. I did not found any simple & usable solution, so I wrote one myself. You can see working solution in my sidebar –>

You will need SimpleXML extension loaded in your PHP configuration and also you’ll need to be able to access data over http. This can be achieved either by setting  allow_url_fopen to 1 or using curl, which is usually allowed in basic PHP setup.

Read more…

Categories: Devel, Howto Tags: , , ,

Firefox 3.0.10 hiccups on Mac OS X

June 7th, 2009 2 comments

Hi all,

for some amount of time, I, myself, have been subject to terrible Firefox short-freezes, or “hiccups” as I call it internally. This issue was causing the browser to freeze for a few seconds (my estimate is 1.3 seconds in average) not just after a action (click, new tab, whatever), but also when browsing – scrolling, flash viewing, etc.

I just found a fix for this issue, so I want to share it with you. First of all I suspected Firebug which I have installed, so I disabled it. No change. Then I consecutively uninstalled all of my plugins. Again, no change. I searched the web for a solution and found nothing on this topic. However, what I have found was a problem when Firefox 2 totally froze when browsing (link).

What they suggested was to disable a function called “Tell me if the site I’m visiting is a suspected forgery“. This setting checks every webpage you access against a list that is automatically downloaded from somewhere (details on http://www.mozilla.com/en-US/firefox/phishing-protection/).

I disabled this, restarted Firefox, and voilà, it worked. There are no more hiccups when browsing. Hope that helps somebody.

Webpage changes monitoring in Bash

February 12th, 2009 No comments

When it comes to university exams, one can pretty often need a tool that checks a web page for changes – e.g. instructions for a exam or simply points gain from the evaulated work.

I did need this today, so I wrote small bash script to help me watch any changes on a specified page.

Read more…

Categories: Devel Tags: ,

Zend_Mail and inline images in e-mail

February 12th, 2009 8 comments

I am currently working on e-mailing subsystem of a project and ran into a situation when I need to send inline picture in the html part of e-mail.

I did not found any helpful information in the ZF documentation so I searched the Internet, combined few solutions and came up with this.
Read more…

Categories: Devel, Howto Tags: , , ,

How to restart Mac OS X Dock

December 2nd, 2008 No comments

Sometimes (but very rarely, fortunately) the Dock in Mac OS X hangs which results in the inability to switch between apps through [cmd]+[tab] or by clicking on icon in the dock.

Solution to this problem is really easy: fire up Terminal and write

killall Dock

(The uppercase D is important.) The Dock will restart automatically.

Categories: Howto, Uncategorized Tags: , ,

Integrating FCKEditor into Zend Framework with Dojo

November 29th, 2008 1 comment

We are now working on a project, that consists of tons of forms. It is being developed using Zend Framework and its Zend_Form component. The need for extensive validation and user-friendliness led us to choose to try out Zend_Dojo_Form, which is shipped with the framework from 1.6.

The usage of Zend_Dojo_Form_Elements is quite easy and is described in many tutorials around the web. What we needed was to use a bit advanced editor than that provided in Dojo library. So far, we were using FCKeditor, which is really feature-rich, in our own intranet framework.

Read more…

Categories: Devel Tags: , , ,

First Post!

November 28th, 2008 No comments

Yup, FIRST!

Categories: Uncategorized Tags: