This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TIMER | |
// CREDITS : http://houtz.tv/javascript/timer.html | |
function start(){ | |
var seconds = 30; | |
var millisec = 0; | |
var timer; | |
function display(){ | |
if (millisec <= 0){ | |
millisec=9; | |
seconds-=1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enter Chat and press enter | |
<div><input id=input placeholder=you-chat-here /></div> | |
Chat Output | |
<div id=box></div> | |
<div id=pubnub pub-key=demo sub-key=demo></div> | |
<script src=http://cdn.pubnub.com/pubnub-3.1.min.js></script> | |
<script>(function(){ | |
var box = PUBNUB.$('box'), input = PUBNUB.$('input'), channel = 'chat'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Overlay (div) | |
var over = $('#over'); | |
// ==================== | |
// STEP 1: SUBSCRIBE() | |
// ==================== | |
// Listen for updates on 'jqtouch' channel. | |
$.PUBNUB.subscribe( { channel : 'jqtouch' }, function(message) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery.PUBNUB.subscribe( args, callback ) | |
jQuery.PUBNUB.subscribe({ | |
channel : 'my_channel' | |
}, function(message) { | |
// Show Message | |
console.log(message); | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar compiler.jar \ | |
--compilation_level ADVANCED_OPTIMIZATIONS \ | |
--js code.js \ | |
| gzip -c9 \ | |
| wc -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Listen for Touch Coordinates | |
PUBNUB.subscribe({ | |
channel : 'touch-receive', | |
callback : update_player | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- DIV to be Updated --> | |
<div id=update-this-with-css class=original-class> | |
<p>This DIV will be updated via remote call.</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div | |
channel-name=notifications-channel | |
segregate-notifications-by-page=false | |
id=desktop-notifications-config | |
></div> | |
<div id=pubnub pub-key=demo sub-key=demo></div> | |
<script src=http://http://cdn.pubnub.com/pubnub-3.5.4.min.js></script> | |
<script | |
src=http://www.pubnub.com/static/html5-desktop-notification-broadcasting.js | |
></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ig.module( | |
'game.main' | |
) | |
.requires( | |
'impact.game', | |
... | |
'plugins.pubnub.game' | |
) | |
.defines(function(){ | |
MyGame = ig.PubNubGame.extend({ ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enter Chat and press enter | |
<div><input id=input placeholder=you-chat-here /></div> | |
Chat Output | |
<div id=box></div> | |
<div id=pubnub pub-key=demo sub-key=demo></div> | |
<script src=http://cdn.pubnub.com/pubnub-3.1.min.js></script> | |
<script>(function(){ | |
var box = PUBNUB.$('box'), input = PUBNUB.$('input'), channel = 'chat'; | |
PUBNUB.subscribe({ | |
channel : channel, |
OlderNewer