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
| thrift: | |
| build: ./gruppoimmobiliare-thrift-server | |
| command: /usr/local/bin/run.sh | |
| ports: | |
| - "8000:80" | |
| links: | |
| - redis | |
| volumes: | |
| # - ./gruppoimmobiliare-thrift-server:/code | |
| - ./gruppoimmobiliare-thrift-server/container_data:/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
| // | |
| // Simple assertion object (useful for testing functions). | |
| // | |
| var Test = { | |
| describe: function(label) { | |
| console.log('\n%s', label); | |
| }, | |
| equals: function(sut, expect) { | |
| (sut === expect) | |
| ? console.log('\t%c ✓ ' + expect, 'color: green') |
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
| server { | |
| listen 80; | |
| root /code; | |
| index /public/index.html; | |
| server_name admin.press.dev; | |
| # access_log /data/nginx/logs/backoffice.access.log; | |
| access_log /dev/stdout; | |
| error_log /dev/stdout notice; |
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
| // http://www.codewars.com/kata/5286d92ec6b5a9045c000087/train/javascript | |
| function convertQueryToMap(query) { | |
| if (query === '') return {}; | |
| var assign = function(obj, keyPath, value) { | |
| lastKeyIndex = keyPath.length - 1; | |
| for (var i = 0; i < lastKeyIndex; ++i) { | |
| key = keyPath[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
| // http://www.codewars.com/kata/52223df9e8f98c7aa7000062/train/javascript | |
| function rot13(str) { | |
| var lower = "abcdefghijklmnopqrstuvwxyz", | |
| upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", | |
| mod = upper.length; | |
| return str | |
| .split('') | |
| .map(function(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
| // http://www.codewars.com/kata/529a92d9aba78c356b000353/train/javascript | |
| function Cons(head, tail) { | |
| this.head = head; | |
| this.tail = tail; | |
| } | |
| function toArray(list) { | |
| if(list) { | |
| var more = list.tail; |
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
| // http://www.codewars.com/kata/5297bf69649be865e6000922/train/javascript | |
| function makeSentence(parts) { | |
| var sentence = parts.join(' '), | |
| lastCharIndex = sentence.match(/(\w) ([\.]+)?$/).index; | |
| return sentence.slice(0, lastCharIndex + 1).replace(/\s?,\s?/g, ', ') + '.'; | |
| } |
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 calculateDamage(yourType, opponentType, attack, defense) { | |
| var superEffective = 2, | |
| neutral = 1, | |
| notVeryEffective = 0.5; | |
| var table = { | |
| 'fire': { | |
| 'fire': notVeryEffective, | |
| 'grass': superEffective, | |
| 'water': notVeryEffective, |
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
| // http://www.codewars.com/kata/515bb423de843ea99400000a/train/javascript | |
| // TODO: complete this object/class | |
| // The constructor takes in an array of items and a integer indicating how many | |
| // items fit within a single page | |
| function PaginationHelper(collection, itemsPerPage){ | |
| this.items = collection; | |
| this.itemsPerPage = itemsPerPage; | |
| } |
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
| // http://www.codewars.com/kata/525f3eda17c7cd9f9e000b39/train/javascript | |
| function recur(n, op) { return (op) ? op.call(op, n) : n; } | |
| function zero(op) { return recur(0, op); } | |
| function one(op) { return recur(1, op); } | |
| function two(op) { return recur(2, op); } | |
| function three(op) { return recur(3, op); } | |
| function four(op) { return recur(4, op); } | |
| function five(op) { return recur(5, op); } | |
| function six(op) { return recur(6, op); } |