Daniele Cruciani
Programmatore Developer PHP/MySQL Freelance
mobile: +39 3489215204

icq skype msn linkedin fb t ff youtube picasa google
seconds to the end of World
End of World 21 December, 2012 11:11:00
Hire me before that day! | don't bother

You are here

Blogs

    Signal page as correct in Google Webmaster Tool (simulate mouse click)

    Google webmaster tool signals scanning errors. The is option to signal error a scorrected, but sometime a lot of error is solved at once, but interface do not give option to select it all.

    Also this trick could be usefull in other service..

    I loaded this code in chrome console (developer tool), modified from example code https://developer.mozilla.org/en/DOM/element.dispatchEvent

    Undefined

    How to hide image to the visitor right click

    Well, I found this hack in http://coollogo.net/cool_logo_70/ a good resource for social icon.

    Given you want to show image.jpg, just put a transparent image in a div tag with the background-image: url('image.jpg') this way:

    English

    Why not to use remove link

    This is my experience: I have to rewrite administration page where
    there is remove button (in a form) with only javascript confirm.

    I thought: "no one had problem with no limitation in the past, why they
    should now? I'll use a link with javascript confirm.

    It happened I have a dashboard page where is listed the last entries
    and links for update and delete its. It happened that few day later 20
    entries was deleted and I was looking for what caused the problem for
    one day.

    Undefined

    Google Chrome no-cache and Login throw oauth services

    I found this very annoying, it seem chrome optimization make it not works things like "login via facebook" or "login via twitter" button with this browser and make it wait forever.

    Undefined

    php goodies: filter

    Filter is in php by default from 5.2.0 and is a usefull library for web developer, so it is the time to make use of it.

    It was created for validation and sanitization of foreign input, that is GET, POST, COOKIE, or anything that you can't trust on.


    With php filter one can tests if a variable is present in the current request:

    Undefined

    wwwsqldesigner short review

    Install

    Download from http://code.google.com/p/wwwsqldesigner/
    Very easy installation: you need a webserver running, unpack
    wwwsqldesigner it in a folder, setup your virtual host (I use
    personal domain for my pc), all done!

    Use

    There is a small tool bar to the right, very simple and intuitive to
    use, it is grouped in 4 areas:

    Undefined

    Defer javascript execution using data

    Due to page performance you should load javascript at the end of page (see http://developer.yahoo.com/performance/rules.html), at least all javascript you can defer to load. There are script that have to load at the very begin of page. But are you sure there is no option?

    Well, actually this is a critical reflection on my own script. When I wrote imagedata drupal example module I replaced to {'imagedata ...} a direct call to jquery plugin.

    English

    Simplepie and CodeIgniter

    yes, found: http://www.haughin.com/code/simplepie/
    and tried with php 5.3 installation ... simply do not work

    I recalled there was a problem in simplepie for assign new by reference, just downloaded newer code from http://simplepie.org/ ... still same problem.

    So

    Undefined

    jquery Form Hint plugin (mine)

    This is my view of form hint plugin: show a div over with the title content inside, instead of replace text in input elements and match it with placeholder
    simply run $(selector).formHint() on all form element and title is used as hint


    See also http://code.google.com/p/jquery-watermark/
    Undefined

    shuffle db table order

    simple code to shuffle a table ... with php shuffle:

    $result = $mysql->query("SELECT id FROM $table ORDER BY id");
    $rows = $result->num_rows;
    $order = shuffle(range(1,$rows));
    while($row=$result->fetch_row()) {
      $num=array_shift($order);
      $mysql->query("UPDATE $table SET rand_sort=$num WHERE id=".$row[0]);
    }
    

    added:
    with MySQL RAND():

    Undefined

    Pages

    Subscribe to RSS - blogs