Skip to content

Instantly share code, notes, and snippets.

View gabrielgpa's full-sized avatar
♨️
🚴‍♂️🎧🎮🎬💻🏝️💡

Gabriel Araújo gabrielgpa

♨️
🚴‍♂️🎧🎮🎬💻🏝️💡
View GitHub Profile
@gabrielgpa
gabrielgpa / clean-workflows.yml
Created June 12, 2024 15:49
Clean WorkFlows Github Actions
name: Clean WorkFlows
on:
schedule:
- cron: "19 2 * * 0" # Every day at 8am.
jobs:
clean:
runs-on: self-hosted
steps:
@gabrielgpa
gabrielgpa / check_pr.yml
Created June 12, 2024 15:48
github_pipeline_example
name: Check Pull Request
on:
pull_request:
branches: [main, release, develop, homolog, test-**]
workflow_dispatch:
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
const puppeteer = require('puppeteer');
async function getPic() {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('myurl');
const dimensions = await page.evaluate(() => {
return {
width: document.documentElement.clientWidth,

Modelo de maturidade Richardson

Apesar de Roy Fielding deixar bastante claro que para uma API ser considerada RESTful ela precisa obrigatoriamente seguir todas as constraints definidas em seu trabalho, na prática, muitas vezes precisamos de uma abordagem um pouco mais simples.

Sendo assim, Leonard Richardson propôs um modelo de 4 níveis para que alcancemos uma API REST.

Os níveis 0, 1 e 2 talvez sejam mais familiares, e de fato são mais fáceis de implementar, porém, deve ficar claro que os mesmos não são considerados RESTful.

screen shot 2018-08-12 at 19 56 38

@gabrielgpa
gabrielgpa / Dockerfile
Last active November 24, 2021 15:03
Configurações de ambiente via Docker para projetos Flutter
FROM ubuntu:18.04
# Prerequisites
RUN apt update && apt install -y curl git unzip xz-utils zip libglu1-mesa openjdk-8-jdk wget
# Set up new user
RUN useradd -ms /bin/bash developer
USER developer
WORKDIR /home/developer
const AWS = require('aws-sdk');
const S3 = new AWS.S3({
accessKeyId: Env.AWS_ACCESS,
secretAccessKey: Env.AWS_SECRET,
region: Env.CONFIG_LOCATION
});
async function getSignedUrl(key) {
if (!key) {
@gabrielgpa
gabrielgpa / docker-install.txt
Created July 15, 2021 13:49
Docker install
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
// Abrir o /etc/apt/sources.list e adicionar a linha abaixo
@gabrielgpa
gabrielgpa / printCyclicObject.js
Created May 25, 2021 14:29
To display cyclic objects in the json string format on the console
let seen = [];
let json = JSON.stringify(node, function(key, val) {
if (typeof val === 'object') {
if (seen.indexOf(val) >= 0) return;
seen.push(val);
}
return val;
});
@gabrielgpa
gabrielgpa / inotify_config.md
Last active May 11, 2021 14:21
Linux - Increasing the inotify watch limit

insert the new value into the system config

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

check that the new value was applied

cat /proc/sys/fs/inotify/max_user_watches

config variable name (not runnable)

fs.inotify.max_user_watches=524288

@gabrielgpa
gabrielgpa / install_remove_xampp.md
Last active May 5, 2021 20:34
Linux | Install/remove XAMPP