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'], | |
| function (amplify) { | |
| var | |
| mentionsDecoder = function( | |
| data, | |
| status, | |
| xhr, | |
| success, | |
| error) { |
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
| <html> | |
| <head> | |
| <title>RequireJS demo</title> | |
| <link rel="stylesheet" href="css/toastr.css"> | |
| <link rel="stylesheet" href="css/toastr-responsive.css"> | |
| </head> | |
| <body> | |
| <button id="incrementButton">Increment</button> | |
| <button id="decrementButton">Decrement</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
| (function (){ | |
| var root = this; | |
| define('jquery', [], function () { return root.$; }); | |
| define('toastr', [], function () { return root.toastr; }); | |
| $('#incrementButton').click(function() { | |
| require(['js/app/counter'], function(c) { | |
| c.increment(); | |
| }); | |
| }); |
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(['jquery', 'toastr'], | |
| function ($, toastr) { | |
| var | |
| logJquery = function (message) { | |
| var elem = $("<li>" + message + "</li>"); | |
| $("#output").append(elem); | |
| }, | |
| logToastr = function (message) { | |
| toastr.success(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
| define(['./logger'], | |
| function (logger) { | |
| var | |
| _c = 0, | |
| increment = function () { | |
| logger.log("incrementing counter to " + ++_c); | |
| return _c; | |
| }, | |
| decrement = function() { | |
| logger.log("decrementing counter to " + --_c); |
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 counterConsoleAdapter = (function (base) { | |
| var | |
| repeat = function(times, m) { | |
| for (var i = 0; i < times; i++) | |
| m(); | |
| }, | |
| increment = function (times){ | |
| if (times === undefined) times = 1; | |
| repeat(times, function () { | |
| console.log("incrementing counter " + |
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 counter = (function () { | |
| var | |
| _c = 0, | |
| increment = function () { | |
| return ++_c; | |
| }, | |
| decrement = function() { | |
| return --_c; | |
| }, |
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 MyClass = function(data) { | |
| var dataChanging = [], | |
| dataChanged = []; | |
| this.data = function(value) { | |
| if (value !== undefined && value !== data) { | |
| for (var i = 0; i < dataChanging.length; i++) { | |
| if (!dataChanging[i](this, value)) { | |
| return 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
| using System; | |
| using System.Linq; | |
| using System.Net; | |
| using System.Text.RegularExpressions; | |
| using System.Threading.Tasks.Dataflow; | |
| namespace TPLDataflow | |
| { | |
| class Program | |
| { |
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
| static void Main(string[] args) | |
| { | |
| Console.Title = "TPL Dataflow"; | |
| var source = new[] { | |
| "elemarjr", "leandronet", "vquaiato", | |
| "juanplopes", "rodrigovidal", "cleytonferrari", | |
| "diogodamiani", "sricanesh", "rodrigokono" | |
| }; |