Skip to content

Instantly share code, notes, and snippets.

View rwillians's full-sized avatar

Rafael Willians rwillians

View GitHub Profile
@rwillians
rwillians / Sentry with docker-compose guide.md
Last active May 10, 2017 22:12
Sentry using docker-compose

Sentry using docker-compose

Sentry is an open-source exception logger which you probably know for its SaaS, though "expection logger" doesn't make justice to what it does.

They also provide a free docker setup available so you can run your own sentry platform in your infrastructure, as you can see in their official Docker Hub repository.

Their documentation is pretty good and you should have no problem getting up and running from there. But I must be honest, I'm too lazy to run all those docker run commands, that's way I've made this docker-compose setup guide.

This gist is supposed to conver only a very basic setup.

@rwillians
rwillians / cluster-down.sh
Created July 14, 2017 18:57
Local Swarm Cluster
#!/bin/bash
forceflag='false'
while getopts 'f' flag; do
case "${flag}" in
f) forceflag='true' ;;
esac
done
@rwillians
rwillians / .tool-versions
Created October 31, 2019 21:02
Sign token using joken
elixir 1.9.2
erlang 22.1
@rwillians
rwillians / index.js
Last active April 2, 2022 22:54
Hacker Rank - DS - 2D Arrays - JavaScript
'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]
]
@rwillians
rwillians / resume.json
Last active January 23, 2024 13:08
resume.json
{
"$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",
@rwillians
rwillians / sample-0.yaml
Last active May 13, 2023 00:43
Sample form representation
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
@rwillians
rwillians / build-push-linux-amd64.sh
Created August 24, 2023 13:34
Scripts for manually building multi-platform image using more than 1 machine
#! /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" \
@rwillians
rwillians / .editorconfig
Last active December 5, 2023 12:37
Project Setup
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true
@rwillians
rwillians / compose.yml
Created January 30, 2024 16:02
nginx X-Forwarded-For and X-Real-IP
version: '3.9'
services:
nginx:
image: nginx:1.25.3-alpine
depends_on:
- api
ports:
- 3000:80
volumes:
@rwillians
rwillians / README.md
Last active February 11, 2024 15:31
if, switch ou strategy

If

Se há apenas duas possibilidades, uso if/else apenas como ternário:

return foo === null
  ? fizz
  : buzz