I hereby claim:
- I am nathanpeck on github.
- I am nathanpeck (https://keybase.io/nathanpeck) on keybase.
- I have a public key whose fingerprint is F2B3 75B6 7540 542A FB63 61B8 F657 950F EF75 2863
To claim this, I am signing this object:
| var api = require('./API.js'); | |
| /** | |
| * http://honeypot.softwareskills.se/#/contest/5587cf988a4c5edb08ffa049 | |
| * | |
| * Executes a single step of the tank's programming. The tank can only move, | |
| * turn, or fire its cannon once per turn. Between each update, the tank's | |
| * engine remains running and consumes 1 fuel. This function will be called | |
| * repeatedly until there are no more targets left on the grid, or the tank runs | |
| * out of fuel. |
| var aws = require('aws-sdk'); | |
| exports.handler = function(event, context) { | |
| var ecsRegion = 'us-east-1'; | |
| // Safegaurd against out of control service scaling | |
| var maxCount = { | |
| deathstar: 6 | |
| }; | |
I hereby claim:
To claim this, I am signing this object:
| CREATE TABLE IF NOT EXISTS `users` ( | |
| `id` int(6) unsigned NOT NULL, | |
| `name` varchar(200) NOT NULL, | |
| PRIMARY KEY (`id`) | |
| ) DEFAULT CHARSET=utf8; | |
| INSERT INTO `users` (`id`, `name`) VALUES | |
| ('1', 'Marceline'), | |
| ('2', 'Finn'), | |
| ('3', 'Jake'); |
| SELECT | |
| m.id id, | |
| m.user `user`, | |
| u.name name, | |
| u.avatar avatar, | |
| m.text `text`, | |
| m.when `when` | |
| FROM messages m | |
| INNER JOIN ( | |
| SELECT `from`, `to` |
| version: "3" | |
| services: | |
| web: | |
| build: ./web | |
| links: | |
| - "stub-api:api" | |
| stub-api: | |
| build: ./stub-api |
Unfortunately as of writing this (Oct 18, 2017) there is no built in integration for multiple target groups per AWS ECS service. Here are a few things you can try:
| FROM mhart/alpine-node:9 AS build | |
| WORKDIR /srv | |
| ADD package.json . | |
| RUN npm install | |
| ADD . . | |
| FROM mhart/alpine-node:base-9 | |
| COPY --from=build /srv . | |
| EXPOSE 3000 | |
| CMD ["node", "index.js"] |
| var server = require('http').createServer(app); | |
| var io = require('socket.io')(server); | |
| var redis = require('socket.io-redis'); | |
| io.adapter(redis({ host: process.env.REDIS_ENDPOINT, port: 6379 })); |
| var numUsers = 0; | |
| // when the client emits 'add user', this listens and executes | |
| socket.on('add user', function (username) { | |
| if (addedUser) return; | |
| // we store the username in the socket session for this client | |
| socket.username = username; | |
| ++numUsers; | |
| addedUser = true; |