Barattalo

Collection of WordPress plugins, code snippets, tools and posts for developers and happy makers

Tiny url encode and decode with PHP

The first functions make short urls using tinyurl.com service. It’s a very popular function on the web, you can find…

Dicembre 29, 2009

Validate email with smtp

This function validate a mail address in a smart way: if the address to validate has a correct syntax (checked…

Dicembre 27, 2009

Decimal Degrees conversion and distance of two points on google map

Those two functions are usefull when you’re making Google Maps applications: When you show the coordinates of a point, it’s…

Dicembre 26, 2009

PHP bot to grab meteo information from Google

Google has many usefull functions that give you data fast, such as cinema infos, or for meteo forecasts. I think…

Dicembre 24, 2009

ASP web bot that get exchange rates

Thanks to Bank of Italy (Banca d’Italia), there are free exchange rates data that are easy to retrieve and parse,…

Dicembre 23, 2009

PHP Session class with crypted cookies.

This class was built to handle session variables, I made this class because once I had to use session variables…

Dicembre 21, 2009

Javascript Ruler for Google Maps v3 to measure distance on map

Javascript example for measuring distances on a Google Maps with a ruler.

Dicembre 19, 2009

Min height cross browser CSS

In CSS version 2 there is a “min-height” property, but it doesn’t work in the same way in every browser,…

Dicembre 17, 2009

Detect user language with PHP

This function uses php server variables to detect the “possible” language of the browser of the connected user. This let…

Dicembre 16, 2009

Mini gallery/slideshow with PHP and JQuery

Sometimes I’ve had to quickly put in a page a simple slideshow, the first times I’ve searched a lot around…

Dicembre 13, 2009

Clustering many markers with Google Maps v3

I’ve found this blog where Matthias Burtscher converted the Marker Cluster (like the Phoogle2) for Google Maps API v.3. Since…

For next project: Google Analytics API

This is a memo, because at the moment I don’t need to use this new API from Google, but since…

Dicembre 8, 2009

How many users are connected?

This two function returns the number of users connected to your site. Since HTTP is asyncronous, the only way to…

Dicembre 3, 2009

Truncate string preserving some words in PHP

When you search in Google for a string, Google highlights with bold text the words you’ve searched in the results…

Novembre 24, 2009

Click links with JavaScript

If you want to click on objects, anchors, table cells or any other html element to emulate the javascript behaviour…

Novembre 18, 2009

Set “write here” on input type text?

If you are using JQuery framework and you want to set up the default value of some text box in…

Novembre 17, 2009

How do I print the elements of an object in Javascript?

This function is similar to the print_r php function: it runs over the elements of an object recursively and put…

Full Screen GControl for Google Maps

Use with phoogle modified class: (see an example here) To use it in the phoogle modified class just turn it…

Novembre 13, 2009

How do I get the value from a combo in Javascript?

If you don’t use any javascript framework such as jquery.js or prototype.js the combo object isn’t so easy to use,…

Cross browser opacity

Is there a css definititon to make cross browser opacity? Yes. I found this, and it seems to work: If…

Novembre 12, 2009

PHP Day add function

How to add 2 days to a date in PHP? There are many ways to add days to a string…

Novembre 11, 2009

ASP equivalent to PHP Ucfirst function

This code does the same thing that Ucfirst function makes in PHP. “Ucfirst” means “Uppercase first letter”. ASP doesn’t have…

Novembre 10, 2009

ASP equivalent to PHP ereg_replace function

I’ve used so many time the php function ereg_replace that when I have to use ASP (‘cause sometimens you have…

OnKeyUp Fix Alphanumerical Chars

When you have an html form and you want only alphanumerical [a-z0-9] chars in your input, you can use this…

Do spelling using google spell checker

If you have a user input that may contains some error you can try to check the spelling using Google…

Parse a float number in javascript

This small code parse a javascript float number to a string. It converts the number to a string and let…

Novembre 9, 2009

Phoogle Modified Class for Google Maps

I was looking for a php class to use on Rockit.it to geo reference band, festivals, labels and other stuff.…

Make square thumbs or cropped thumbs with php

This is a thumb generator php class. I’ve been searching a lot for some code to make good thumbs on…

Stop UTF8 problems with special characters

I’m italian and I always need to use special chars like è é à ù. The same need belongs to…

Execute Scalar and Execute Row for Php

A couple of simple functions thar returns the first value and the first row of a result set. Very usefull.…