Se há apenas duas possibilidades, uso if/else apenas como ternário:
return foo === null
? fizz
: buzz| const rescue = require('express-rescue') | |
| class UserNotFound extends Error {} | |
| // ... | |
| app.get('/users/:id', [ | |
| rescue(async (req, res) => { | |
| throw new UserNotFound(/* ... */) | |
| }, |
| version: '3.9' | |
| services: | |
| nginx: | |
| image: nginx:1.25.3-alpine | |
| depends_on: | |
| - api | |
| ports: | |
| - 3000:80 | |
| volumes: |
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| indent_size = 2 | |
| insert_final_newline = true | |
| indent_style = space | |
| trim_trailing_whitespace = true |
| #! /usr/bin/env sh | |
| # | |
| # Rode em uma máquina x64 (intel/amd) | |
| # | |
| VERSION='0.2.5' | |
| docker --context=default buildx build \ | |
| -t "ghcr.io/rwillians/rinha-de-backend--elixir-plug-bandit-ecto:${VERSION}-amd64" \ |
| fields: | |
| - name: user-name | |
| label: What's your name? | |
| type: short-text | |
| required: true | |
| data: | |
| placeholder: Jane Doe | |
| - name: user-email | |
| label: What's your email? | |
| type: email |
| { | |
| "$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/master/schema.json", | |
| "meta": { | |
| "theme": "elegant" | |
| }, | |
| "basics": { | |
| "name": "Rafael Willians", | |
| "label": "Sr. Backend engineer", | |
| "pronoums": "he/him", | |
| "image": "https://s.gravatar.com/avatar/0d7ab408fb9411f7950957dfaa9d5472?s=100&r=pg&d=mm", |
| 'use strict' | |
| const input = [ | |
| [-9, -9, -9, 1, 1, 1], | |
| [ 0, -9, 0, 4, 3, 2], | |
| [-9, -9, -9, 1, 2, 3], | |
| [ 0, 0, 8, 6, 6, 0], | |
| [ 0, 0, 0, -2, 0, 0], | |
| [ 0, 0, 1, 2, 4, 0] | |
| ] |
| elixir 1.9.2 | |
| erlang 22.1 |
| #!/bin/bash | |
| forceflag='false' | |
| while getopts 'f' flag; do | |
| case "${flag}" in | |
| f) forceflag='true' ;; | |
| esac | |
| done |