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> | |
| <head> | |
| <title>Deferred Objects</title> | |
| </head> | |
| <body> | |
| <p id="p1">This paragraph fadeOut in 1000ms</p> | |
| <p id="p2">This paragraph fadeOut in 2000ms</p> | |
| <button id="fadeOutButton">fade out now!</button> |
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> | |
| <head> | |
| <title>Deferred Objects</title> | |
| </head> | |
| <body> | |
| <p id="p1">This paragraph fadeOut in 1000ms</p> | |
| <p id="p2">This paragraph fadeOut in 2000ms</p> | |
| <button id="fadeOutButton">fade out now!</button> |
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> | |
| <head> | |
| <title>Deferred Objects</title> | |
| </head> | |
| <body> | |
| <div id="output"></div> | |
| <script src="http://code.jquery.com/jquery-latest.js"></script> |
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> | |
| <head> | |
| <title>Deferred Objects</title> | |
| </head> | |
| <body> | |
| <button id="resolveButton">resolve</button> | |
| <button id="rejectButton">reject</button> | |
| <button id="getStateButton">get state</button> |
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> | |
| <head> | |
| <title>Sammy demo</title> | |
| </head> | |
| <body> | |
| <ul id='content'></ul> | |
| <form action='#/addLine' method='post'> |
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
| define(['amplify', 'jquery'], | |
| function (amplify, $) { | |
| var | |
| data, | |
| init = function() { | |
| $.mockJSON.data.STATE = | |
| [ 'RS', 'SP', 'RJ', 'MG']; | |
| $.mockJSON.data.CUSTOMER_FIRST_NAME = | |
| ['Elemar', 'Gabriel', 'Israel', 'Pedro']; | |
| $.mockJSON.data.CUSTOMER_LAST_NAME = |
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
| var fibonacci = _.memoize(function(n) { | |
| return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); | |
| }); |
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
| var numbers = [1,2,3,4,8]; | |
| var q = _.countBy(numbers, function(x) { return x % 2 == 0 ? 'even' : 'odd'; } ); | |
| // q = { "odd": 2, "even": 3} |
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
| var numbers = [1,2,3,4,5,6,7,8,9,0,11]; | |
| var gt5 = _.select(numbers, function (x) { return x > 5; }); | |
| // gt5 = [6,7,8,9,11] | |
| var squares = _.map(numbers, function (x) { return x * x; }); | |
| // squares = [1,4,9,16,25,36,49,81,0,121] | |
| var product = _.reduce(gt5, function (a,b) { return a * b; } , 1); | |
| // product = 33264 |
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(['app/ds.twitter'], function (ds) { | |
| var callbacks = { | |
| success : function(result) { | |
| // aqui, tratamento os resultados ... | |
| }, | |
| error : function(error, status) { | |
| // aqui, tratamento caso algo ocorra de errado... | |
| } | |
| }; | |
| ds.getMentions(callbacks, 'elemarjr'); |