Skip to content

Instantly share code, notes, and snippets.

View garciasdos's full-sized avatar
🦫

Diego García garciasdos

🦫
View GitHub Profile
const input = document.children[0].textContent.split('\n').filter(x => x.length).map(movement => movement.split(' '))
input.reduce((acc, currentTuple, index, array) => {
switch(currentTuple[0]) {
case "forward": acc[0] = acc[0] + parseInt(currentTuple[1]); break;
case "up" : acc[1] = acc[1] + parseInt(currentTuple[1]); break;
case "down": acc[1] = acc[1] - parseInt(currentTuple[1]); break;
}
return acc;
}, [0, 0]);
@garciasdos
garciasdos / Dockerfile
Last active August 17, 2022 20:28
Symfony 5.0 && PHP 7.4 minimal installation
FROM php:7.4-fpm-alpine
WORKDIR /var/www/app
RUN apk add bash
# intl
RUN apk add --quiet zlib-dev icu-dev g++
RUN docker-php-ext-install intl && docker-php-ext-enable intl