Skip to content

Instantly share code, notes, and snippets.

@feedhenry-gists
feedhenry-gists / gist:1015157
Created June 8, 2011 19:26
Hashing Device Call
$fh.hash( parameters, function(res){
//success callback function. responses are passed into res object
}, function(error){
//failure callback function. error contains the error message
});
@feedhenry-gists
feedhenry-gists / gist:1015166
Created June 8, 2011 19:32
Hashing Cloud Call
var res = $fh.hash( parameters ); //res will contain an 'error' key if it's failed
@feedhenry-gists
feedhenry-gists / gist:1015167
Created June 8, 2011 19:33
Hashing Hash Value
$fh.hash(
{
algorithm:'MD5|SHA1',
text:'<Input text for hashing>'
}
);
@feedhenry-gists
feedhenry-gists / gist:1015172
Created June 8, 2011 19:34
Hashing Response
{
hashvalue:"<The hash value of the input text>"
}
$fh.geoip( function(res) { alert(JSON.stringify(res.geoip)); });
@feedhenry-gists
feedhenry-gists / gist:1015184
Created June 8, 2011 19:39
Geolocation Call
$fh.geo( {interval:5000}, function(res){
alert( 'lon='+res.lon+', lat='+res.lat+', alt='+res.alt+', at='+res.when);
} );
@feedhenry-gists
feedhenry-gists / gist:1015187
Created June 8, 2011 19:39
Geolocation Call
$fh.geo( {interval:5000}, function(res){
alert( 'lon='+res.lon+', lat='+res.lat+', alt='+res.alt+', at='+res.when);
} );
@feedhenry-gists
feedhenry-gists / gist:1015194
Created June 8, 2011 19:41
Local Storage Call
$fh.data( {act:'save', key:'foo', val:'bar'} );
$fh.data( {key:'foo'}, function(res) {
alert( res.key+'='+res.val );
}
$fh.log( {message:'your log message'} );
$fh.geo({interval: 0}, function(res){
$fh.map({target: '#map_div', lat:res.lat, lon:res.lon, zoom:9}, function(map){
console.log(map.map);
}, function(msg){
console.log(msg);
});
})