Google Maps: address geocoding using php

The following code shows how to geocode an address to obtain google maps latitude and longitude values:

et voilà!


Joomla: email validation

The following code shows how to validate an email with Joomla API


Sencha Touch 2: Mobile emulation from Chrome browser

The new versions of Chrome allow you to test your Mobile HTML App simulating device screen. This is particularly useful considering the reduced screen size of mobile phones compared to what is available on your chrome browser running on your desktop screen.

Console Emulation is available from Chrome Developer Tools, and can be activated from setting panel:



You will be able then to locate the Emulation Panel and select the preferred device from the option available getting the screen emulation for the device selected:




Sencha Touch 2 and Phonegap: The connection to the server was unsuccessful error

Some Sencha Touch 2 and or Phonegap built App may suffer from this error at startup, depending on the amount of scripts loaded, the startup loop time, the performance of the current device or emulator, the lack of a splash screen.

Connection to server was unsuccessful. (file:///android_asset/www/index.html)

As workaround to fix the error you can adopt the following approach:

  1. Rename your App index.html to main.html
  2. Create a new index.html with the following content
  3. Rebuild your app and go!

Sencha Touch 2 – first steps tutorial – generate and compile app

sencha-tools-250First of all make sure you have downloaded and istalled proper Sencha Touch 2 archive you can download from:

Ensure you have also installed the Sencha CMD you can download at:

Install the CMD archive downloaded and copy the Sencha Touch 2 archive to your htdocs folder of your AMP installation.

Enter the sencha directory in your htdocs folder and create your first app with the command:

to build your app you can enter the yourApp folder and type the following command:

You can also launch your new App directly in the simulator with the following command:


Joomla params/forms YES/NO radio button option

Here below the code for a YES/NO radio button option suitable for example for published option in your table records:

YES is the default option in this specific case.


Joomla – get user groups programmatically

The following code illustrates how to access groups an user is subscribed with Joomla ACL. Groups ids are returned in an array

To test the code, do not forget to lougout and login again should you have modified the user group from the back-end



Amiga Workbench Emulator in chromeexperiments

A500jsAmiga Workbench Emulator It’s a full javascript (~3000 lines of code) remake of the classic Amiga’s operating system “Workbench 1.3”.
You can change resolution, color, font, wallpaper, move icons, open/resize windows, launch several little visuals effects.
Also the “CLI” (command manager) is working, you can access all the different command by typing “command” at the prompt.
Amiga Workbench Emulator is part of a set of Javascript applications created by google and published on the Chrome Experiments web site to promote its Chrome web browser and test its ability with Javascript code (according to the developer much faster than other browsers).
On the same site you can find more javascript application as fun as Amiga Workbench Emulator. These demos are of course playable also with the other (modern) browsers.
It is possible also to send your own demo; this will be published on the site with a discrete visibility benefit for the developer.


Javascript class example

Here is an example on how to use classes and methods in Javascript:



Javascript Arrays – push and remove items

If you are working with Javascript Array, you would probably benefit from these additional functions handling Array elements. They allow to add and remove items without fetching the whole array.

To push an item to the Array (unique item) we are using the following function:

To remove an item to the Array we can use the following function:

How to use it:

Schermata 2014-03-15 a 19.42.44