Skip to content

Instantly share code, notes, and snippets.

View vinicius73's full-sized avatar
🤓
"Those who cannot acknowledge themselves, will eventually fail."

Vinicius Reis vinicius73

🤓
"Those who cannot acknowledge themselves, will eventually fail."
View GitHub Profile
@vinicius73
vinicius73 / .prettierignore
Last active May 23, 2022 14:51
prettierrc
.vscode/
.yarn/
dist/
coverage/
public/
@vinicius73
vinicius73 / .eslintignore
Created April 20, 2022 14:53
Eslint + Prettier + Vue v2
/.yarn/**
/dist/**
/node_modules/**
@vinicius73
vinicius73 / acm.tf
Created March 5, 2022 13:55
Terraform + Cloudfront Static file CDN
# https://docs.aws.amazon.com/pt_br/acm/latest/userguide/acm-regions.html
resource "aws_acm_certificate" "this" {
provider = aws.virginia # need to be created at virginia (cloudfront bizarre)
domain_name = local.host
subject_alternative_names = local.alias
validation_method = "DNS"
lifecycle {
create_before_destroy = true
@vinicius73
vinicius73 / .dockerignore
Last active February 22, 2022 14:42
Vue Caddy server
node_modules
dist
infra
.tmp
# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
@vinicius73
vinicius73 / Caddyfile
Created November 12, 2021 15:06
Caddy SPA Docker Build
{
admin off
log {
format json
}
}
:80 {
try_files {path} /
header /assets/img/* Cache-Control max-age=31536000
FROM golang:1.15.5-alpine3.12 as sidecar
WORKDIR /go/src/app
COPY ./docker/sidecar/ ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-s -w -extldflags "-static"' -o bin/sidecar . && \
chmod +x ./bin/sidecar
FROM node:12.19.0-alpine3.9 as build-stage
@vinicius73
vinicius73 / messageBroker.js
Last active May 14, 2020 23:45
Vue.js EventBus approach
const listeners = ctx => {
if (!ctx.$options.on) {
return
}
const listeners = {}
Object.entries(ctx.$options.on)
.forEach(([event, callback]) => {
listeners[event] = callback.bind(ctx)
@vinicius73
vinicius73 / Makefile
Last active March 29, 2020 20:16
Terraform + Digital Ocean Spaces
init:
@read -p "SPACES_ACCESS_TOKEN=" SPACES_ACCESS_TOKEN; \
read -p "SPACES_SECRET_KEY=" SPACES_SECRET_KEY; \
read -e -p "SPACE_BUCKET_NAME=" -i "space-name" SPACE_BUCKET_NAME; \
terraform init \
-backend-config="access_key=$$SPACES_ACCESS_TOKEN" \
-backend-config="secret_key=$$SPACES_SECRET_KEY" \
-backend-config="bucket=$$SPACE_BUCKET_NAME"
plan:
package xx
class Deferrer {
private val actions = arrayListOf<() -> Unit>()
fun defer(f: () -> Unit) {
actions.add(f)
}
fun done() {
@vinicius73
vinicius73 / Dockerfile
Last active March 22, 2020 22:51
Docker - Front-end APP
FROM node:12-alpine as build-stage
RUN apk add --no-cache curl gnupg libstdc++
WORKDIR /app
COPY package*.json ./
COPY yarn.lock ./
RUN yarn install
COPY . .
ARG MODE=production