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
| const data = [ | |
| "123 328 51 64 ", | |
| " 45 64 387 23 ", | |
| " 6 98 215 314", | |
| "* + * + ", | |
| ]; | |
| const len = data.length; | |
| let total = 0; | |
| let subTotal = 0; |
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
| const input = [ | |
| { start: "11", end: "22" }, | |
| { start: "95", end: "115" }, | |
| { start: "998", end: "1012" }, | |
| { start: "1188511880", end: "1188511890" }, | |
| { start: "222220", end: "222224" }, | |
| { start: "1698522", end: "1698528" }, | |
| { start: "446443", end: "446449" }, | |
| { start: "38593856", end: "38593862" }, | |
| { start: "565653", end: "565659" }, |
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
| const input = ["L68", "L30", "R48", "L5", "R60", "L55", "L1", "L99", "R14", "L82"]; | |
| let pointer = 50; | |
| const result = input | |
| .map((instruction) => { | |
| const direction = instruction.charAt(0); | |
| const distance = parseInt(instruction.slice(1), 10); | |
| return { direction, distance }; | |
| }) | |
| .reduce((acc, { direction, distance }) => { | |
| const toMove = distance % 100; |
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
| <?xml version='1.0' encoding='utf-8'?> | |
| <SHOP> | |
| <SHOPITEM> | |
| <ITEM_ID>PUMA-001</ITEM_ID> | |
| <PRODUCTNAME>Puma tenisky - Velikost 36</PRODUCTNAME> | |
| <DESCRIPTION><p>Stylové a pohodlné tenisky Puma pro každodenní nošení.</p></DESCRIPTION> | |
| <PRODUCT>Puma tenisky, velikost 36, barva: černá</PRODUCT> | |
| <IMGURL>https://picsum.photos/400/500</IMGURL> | |
| <EAN>4066748333578</EAN> | |
| </SHOPITEM> |
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 view = new CounterView({ | |
| collection: new NotificationsCollection() | |
| }); | |
| this.spy(view, 'render'); | |
| view.collection.add([{}]); | |
| assert(view.render.calledOnce); |
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 ListCollection = Backbone.Collection.extend({ | |
| model: Bid, | |
| comparator: function (bid) { | |
| return -(new Date(bid.get('date'))).getTime(); | |
| }, | |
| sortASC: function (key) { | |
| return this.sortBy(function (model) { | |
| return model.get(key); |
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
| jshint: { | |
| options: { | |
| "browser": true, | |
| "node": false, | |
| .. | |
| "maxlen": 80, | |
| globals: { | |
| myBrowserGlobal: true | |
| }, | |
| reporters: [ |
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
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.onIdle = function(ev) { | |
| var robot = ev.robot; | |
| robot.ahead(100); |
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
| <?php | |
| $a = 0; | |
| $b = 'x'; | |
| var_dump(FALSE == $a); | |
| var_dump($a == $b); | |
| var_dump($b == TRUE); | |
| ?> |
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
| info: Welcome to Nodejitsu chazm | |
| info: jitsu v0.9.8 | |
| info: It worked if it ends with Nodejitsu ok | |
| info: Executing command deploy | |
| info: Analyzing application dependencies in app.js | |
| /usr/local/lib/node_modules/jitsu/node_modules/require-analyzer/node_modules/npm/lib/npm.js:299 | |
| if (!conf.hasOwnProperty("prefix")) { | |
| ^ | |
| TypeError: Object #<error> has no method 'hasOwnProperty' |
NewerOlder