Skip to content

Instantly share code, notes, and snippets.

View mauriciomutte's full-sized avatar
👨‍💻
Coding

Maurício Mutte mauriciomutte

👨‍💻
Coding
View GitHub Profile
@mauriciomutte
mauriciomutte / aws-cdn.tf
Created March 18, 2023 21:23
Terraform recipe to create an AWS infra (S3 + CloudFront CDN)
provider "aws" {
region = "us-east-1"
}
# ------------------------------------------------------------------------------------
# VARIABLES
# ------------------------------------------------------------------------------------
locals {
tags = {
@mauriciomutte
mauriciomutte / machine.js
Last active September 12, 2022 22:09
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@mauriciomutte
mauriciomutte / generate-certificate.ssh
Last active September 6, 2022 12:49
Generate a self-signed SSL certificate using OpenSSL?
openssl req -x509 -out localhost.crt -keyout localhost.key \
-days 365 \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
@mauriciomutte
mauriciomutte / gh-alias.sh
Last active August 24, 2022 19:46
Generate GH CLI alias to improve productivity
#!/bin/sh
# open repository in browser
gh alias set --shell web \
'gh repo view --web'
# get the current branch/PR infos
gh alias set --shell prinfo \
'gh pr view --json title,number --template "\"$(printf "#%v"){{.number}}\" \"{{.title}}\""'
@mauriciomutte
mauriciomutte / auto-merge.yml
Created November 4, 2021 17:11
Dependabot auto merge
name: auto-merge
on:
pull_request_target:
branches:
- master
jobs:
auto-merge:
runs-on: ubuntu-latest
@mauriciomutte
mauriciomutte / test-utils.tsx
Last active May 7, 2021 00:31
Testing-library + styled-components + Typescript
import { ReactElement } from 'react';
import { ThemeProvider } from 'styled-components';
import { render, RenderOptions } from '@testing-library/react';
import theme from 'styles/theme';
type CustomRenderProps = Omit<RenderOptions, 'queries'>;
const customRender = (ui: ReactElement, options: CustomRenderProps = {}) =>
render(<ThemeProvider theme={theme}>{ui}</ThemeProvider>, options);
@mauriciomutte
mauriciomutte / .zshrc
Last active February 5, 2021 14:02
ohmyzsh-config
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/mauriciomutte/.oh-my-zsh"
ZSH_THEME="spaceship"
plugins=(git)
{
"editor.suggestSelection": "first",
"editor.renderLineHighlight": "gutter",
"editor.tabSize": 2,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {