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
| # Support Developer — Ruby Interview (candidate sheet) | |
| **Context:** You've joined the support-engineering team for an online store. The backend is Ruby | |
| (Rails-flavoured: `Order`, `LineItem`, `Coupon`, `Subscription`, `Warehouse` are database models). | |
| **Money is stored in integer cents** everywhere. | |
| **Three segments.** Everything is **read-only** — you don't need to run anything or set | |
| anything up. Talk out loud as you go; we care more about *how* you read code and reason than about a | |
| perfect fix. |
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
| # frozen_string_literal: true | |
| # Question: | |
| # a = 1 | |
| # b = 2 | |
| # a ||= b | |
| # | |
| # What is the result? | |
| begin |
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
| export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0] | |
| export const isRelativeURL = u => | |
| u && u.length && /^\/[a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*[?]?([^#]*)#?([^#]*)$/.test(u) | |
| export default function ({ app }) { | |
| const redirect = function (name, noRouter = false) { | |
| if (!this.options.redirect) { | |
| return | |
| } |
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
| version: '3' | |
| services: | |
| nginx-proxy: | |
| image: jwilder/nginx-proxy | |
| labels: | |
| com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" | |
| container_name: nginx-proxy | |
| restart: unless-stopped | |
| ports: |
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
| FROM nginx:stable-alpine | |
| ENV NPM_CONFIG_LOGLEVEL info | |
| ENV NODE_VERSION 8.2.1 | |
| RUN addgroup -g 1000 node \ | |
| && adduser -u 1000 -G node -s /bin/sh -D node \ | |
| && apk add --no-cache \ | |
| libstdc++ \ | |
| && apk add --no-cache --virtual .build-deps \ |