Skip to content

Instantly share code, notes, and snippets.

@feedhenry-gists
feedhenry-gists / gist:1024685
Created June 14, 2011 11:01
Current Date/Time Modify client Code
function readTime() {
$fh.act({act:'getCurrentTime'}, function(res) {
// Convert the response into a jQuery Object
var resObj = $(res.response);
// Extract the element with the id of 'ct' - this is the element that contains the time
var time = resObj.find('#ct');
// Display the time in-app using jQuery
@feedhenry-gists
feedhenry-gists / gist:1024683
Created June 14, 2011 11:00
Current Date/Time Cache Server Side
function getCurrentTime() {
var response = $fh.web({
url: 'http://www.timeanddate.com/worldclock/city.html?n=78',
method: 'GET'
});
return {'response': response.body};
}
@feedhenry-gists
feedhenry-gists / gist:1019250
Created June 10, 2011 16:53
Image Sprites Example 2 Login
#login:
{ background: url(../images/sprite.png) scroll 0 -410px no-repeat;
display:block;
width: 137px;
height: 40px;
}
#login:hover
{
background-position: 160px -410px;
@feedhenry-gists
feedhenry-gists / gist:1019248
Created June 10, 2011 16:52
Image Sprites Example 2
<html>
<head>
<style>
<link href="style.css" rel="stylesheet" type="text/css" />
</style>
</head>
<body>
<div id=”logo”></div>
<div id=”login”></div>
@feedhenry-gists
feedhenry-gists / gist:1019246
Created June 10, 2011 16:50
Image Sprites CSS
#logo {
background: url(../images/sprite.png) scroll 0 0 no-repeat;
display:block;
width: 212px;
height: 35px;
}
@feedhenry-gists
feedhenry-gists / gist:1019243
Created June 10, 2011 16:50
Image Sprites Example 1
Example 1:
On your html document, create a div called ‘logo’:
<html>
<head>
<style>
<link href="style.css" rel="stylesheet" type="text/css" />
</style>
</head>
<body>
<div id=”logo”></div>
$fh.handlers({type:'back'}, function(){
if(exit_app){
return true; //This will close the app
} else {
return false; //This will keep the app active
}
})
@feedhenry-gists
feedhenry-gists / gist:1019182
Created June 10, 2011 16:16
Security Get A Key Response
{
key: '<hex value of the key>'
}
@feedhenry-gists
feedhenry-gists / gist:1019180
Created June 10, 2011 16:15
Security Get a Key
$fh.sec({
act:'getkey',
params:
{keytype:'public|private|secret|modulu',
__cuid:'<optional-client unique device id>',
__session_id:'<optional-session id for the key>'}
});
@feedhenry-gists
feedhenry-gists / gist:1019178
Created June 10, 2011 16:14
Security Save A Key Response
{
result:'success'
}