Skip to content

Instantly share code, notes, and snippets.

View tgmarinho's full-sized avatar
💻
read my blog: tgmarinho.com

Thiago Marinho tgmarinho

💻
read my blog: tgmarinho.com
View GitHub Profile
@tgmarinho
tgmarinho / main.md
Created May 10, 2024 14:00
Workflow Development Feature Flag, Tag Releases

VIVA LA MAIN

The proposal is to maintain only one branch: main.

Dev opens a PR, and CI runs tests, checks if the build passes, code review is done, and the merge is made to main.

All new code on main will generate a new CI and CD, a release for the staging environment, where QA is performed by stakeholders (Dev, QA, Product).

Control of what can be displayed by environment is done through feature flags, basically an if statement in the code that checks if the feature can be activated or deactivated in environment X (staging | production).

@tgmarinho
tgmarinho / cc.md
Created April 19, 2024 20:48 — forked from noghartt/cc.md
Resources to learn more about Computer Science and related stuffs

VIVA LA MAIN

A proposta é manter apenas uma branch: main.

Dev abre PR, e o CI roda testes, verifica se build passa, é feito code review e o merge é feito para main.

Todo código novo na main vai gerar uma nova CI e CD, uma release para ambiente de staging, onde é feito o QA pelas partes interessadas (Dev, QA, Product).

O controle do que pode ser exibido por ambiente é feito por feature flags, basicamente um if no código que verifica se no ambiente X (staging | production) a feature pode ser ativada ou desativada.

@tgmarinho
tgmarinho / production-api-and-cronjobs.yml
Created April 10, 2024 13:56
main branch - .github/actions
name: Deploy COMPANY API & Cronjobs API Production
concurrency:
group: production-api-${{ github.ref }}
on:
push:
branches:
- main
@tgmarinho
tgmarinho / .tsx
Created February 16, 2024 17:44 — forked from dutradotdev/.tsx
BlurContainer in React Native
import React from 'react';
import WebView from 'react-native-webview';
export type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
export interface BlurContainerProps {
backgroundColor: RGBA;
blurRadius: number;
}
"use client";
import 'core-js/stable';
import { motion } from "framer-motion";
import { CalendarDays, CheckIcon, CreditCard, MapPin } from "lucide-react";
import Link from "next/link";
import Button from "../Button";
import React from "react";
import QRCode from "qrcode.react";
import { useOpenPix } from '@openpix/react';
@tgmarinho
tgmarinho / adjascent_state.js
Last active September 16, 2023 00:39
adjascent_state.js
const estados = [
{ name: 'Alabama', abbreviation: 'AL', id: 1 },
{ name: 'Alaska', abbreviation: 'AK', id: 2 },
{ name: 'American Samoa', abbreviation: 'AS', id: 3 },
{ name: 'Arizona', abbreviation: 'AZ', id: 4 },
{ name: 'Arkansas', abbreviation: 'AR', id: 5 },
{ name: 'California', abbreviation: 'CA', id: 6 },
{ name: 'Colorado', abbreviation: 'CO', id: 7 },
{ name: 'Connecticut', abbreviation: 'CT', id: 8 },
{ name: 'Delaware', abbreviation: 'DE', id: 9 },
-- SHIFT 1
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-01 14:00:00-04', '2023-08-01 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
module.exports = {
up: function (queryInterface, Sequelize) {
return Promise.all([
queryInterface.addColumn('User', 'name', {
type: Sequelize.STRING
}),
queryInterface.addColumn('User', 'nickname', {
type: Sequelize.STRING,
})
]);
@tgmarinho
tgmarinho / settings.json
Last active February 7, 2024 12:32
vscode settings
{
"emmet.syntaxProfiles": {
"javascript": "jsx"
},
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 16,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [
80,