This file contains hidden or 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
| # | |
| # colorPicker | |
| # | |
| # Allows the user to select a color from available `colors`, and emits the selected color. | |
| # | |
| # Attributes: | |
| # currColor: The currently selected color, as a hex string e.g. '#ffffff' | |
| # colors: An array of available colors, as hex strings | |
| # visible: true | false Show or hide the color selector | |
| # |
This file contains hidden or 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
| # | |
| # as | |
| # | |
| # When added as attribute to custom directive, exposes the isolate scope of the directive to parent scope | |
| # | |
| # Attributes: | |
| # as: Name to save isolate scope as on parent scope | |
| ## | |
| # Example: | |
| ### |
This file contains hidden or 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
| {#each :card.fields as :card_field} | |
| {#if not(equal(:card_field.type, 'score-system'))} | |
| <derby:view ns="lui" view=cardFields:{{:card_field.type}}:showCard> | |
| {/} | |
| {/} |
This file contains hidden or 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
| // BAD | |
| for (var key in this._workingPeers) { | |
| var peer = this._workingPeers[key]; | |
| } | |
| // GOOD | |
| var indices = Object.keys(this._workingPeers); | |
| for (var i = 0; i < indices.length; i++) { | |
| var peer = this._workingPeers[indices[i]]; | |
| } |
This file contains hidden or 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
| require(['libs/now/0.7.4/now'], function(Now) { | |
| Now.pong = function(){ | |
| alert('pong!'); | |
| } | |
| Now.ready(function(){ | |
| Now.ping(); | |
| }); | |
| } |
This file contains hidden or 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
| <script src="/socket.io/socket.io.js"></script> | |
| <script> | |
| var socket = io.connect(); | |
| socket.on('connect', function(){ | |
| socket.emit('print', 'a'); | |
| socket.emit('print', 'b'); | |
| }); | |
This file contains hidden or 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
| <script src="/socket.io/socket.io.js"></script> | |
| <script> | |
| var i = 0; | |
| var socket = io.connect(); | |
| socket.on('connect', function(){ | |
| setInterval(function(){ | |
This file contains hidden or 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
| <script src="/socket.io/socket.io.js"></script> | |
| <script> | |
| var socket = io.connect(); | |
| socket.on('a', function(){ | |
| //alert(1); | |
| }); | |
| socket.on('b', function (data) { |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>nowjs test</title> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> | |
| <script src="/nowjs/now.js"></script> | |
| <script> | |
| $(function(){ | |
| now.receiveMessage = function(name, message){ |
This file contains hidden or 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
| <script src="http://localhost/socket.io/socket.io.js"></script> | |
| <script> | |
| var socket = new io.Socket('localhost'); | |
| socket.connect(); | |
| socket.on('connect', function(){ | |
| alert("connected"); | |
| }) | |
| socket.on('message', function(){ }) |