Skip to content

Instantly share code, notes, and snippets.

View FeMaffezzolli's full-sized avatar
👨‍💻
working

Felipe Maffezzolli FeMaffezzolli

👨‍💻
working
View GitHub Profile
@FeMaffezzolli
FeMaffezzolli / working-faster-matters.md
Last active June 14, 2023 02:46
Working Faster Matters

Speed matters: Why working quickly is more important than it seems

by James Somers, July 26, 2015

The obvious benefit to working quickly is that you’ll finish more stuff per unit time. But there’s more to it than that. If you work quickly, the cost of doing something new will seem lower in your mind. So you’ll be inclined to do more.

The converse is true, too. If every time you write a blog post it takes you six months, and you’re sitting around your apartment on a Sunday afternoon thinking of stuff to do, you’re probably not going to think of starting a blog post, because it’ll feel too expensive.

What’s worse, because you blog slowly, you’re liable to continue blogging slowly—simply because the only way to learn to do something fast is by doing it lots of times.

export const cities = [
{
ibgeCode: 5200050,
name: 'Abadia de Goiás',
latitude: '-16.7573',
longitude: '-49.4412',
stateAbbreviatedName: 'GO',
},
{
ibgeCode: 3100104,
import { DateTime, Duration } from 'luxon'
import { v4 as uuid } from 'uuid'
interface RecurringRule {
interval?: keyof Duration;
intervalCount?: number;
byWeekDay?: number[];
byMonthDay?: number[];
count?: number;
until?: string;
import NextAuth, { NextAuthOptions } from 'next-auth'
import CredentialsProvider from 'next-auth/providers/credentials'
import { serverClient } from '../../../server/client'
type AuthResponse = {
access_token: string
expires_in: number
token_type: string
scope: string
refresh_token: string
@FeMaffezzolli
FeMaffezzolli / openai-node.js
Last active January 6, 2023 22:10
openai-node
const express = require("express");
const OpenAI = require("openai-api");
const app = express();
const port = 3000;
// load API_KEY from env
const OPENAI_API_KEY = "API_KEY";
const openai = new OpenAI(OPENAI_API_KEY);
const sendMessage = async (message) => {
@FeMaffezzolli
FeMaffezzolli / index.html
Created November 23, 2022 11:57
Lo-fi Chat - with Tailwind CSS
<body class="flex flex-col items-center justify-center w-screen min-h-screen bg-gray-100 text-gray-800 p-10">
<!-- Component Start -->
<div class="flex flex-col flex-grow w-full max-w-xl bg-white shadow-xl rounded-lg overflow-hidden">
<div class="flex flex-col flex-grow h-0 p-4 overflow-auto">
<div class="flex w-full mt-2 space-x-3 max-w-xs">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-gray-300"></div>
<div>
<div class="bg-gray-300 p-3 rounded-r-lg rounded-bl-lg">
<p class="text-sm">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
@FeMaffezzolli
FeMaffezzolli / pure_css_typing_animation.html
Created October 17, 2021 02:20
Pure CSS Typing Animation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap" rel="stylesheet">
@FeMaffezzolli
FeMaffezzolli / seeder.ts
Created September 30, 2021 21:28
Adonis.js Seed Example (without factory)
import faker from 'faker'
import { sample } from 'lodash'
import { DateTime } from 'luxon'
import BaseSeeder from '@ioc:Adonis/Lucid/Seeder'
import User from 'App/Models/User'
import Transaction from 'App/Models/Transaction'
import TransactionCategory from 'App/Models/TransactionCategory'
import TransactionSubCategory from 'App/Models/TransactionSubCategory'
@FeMaffezzolli
FeMaffezzolli / countries.ts
Last active November 10, 2021 18:51
Countries and Calling Country Codes
const COUNTRIES = [
{ countryCode: '1 340', emoji: '', country: 'Virgin Islands' },
{ countryCode: '1 670', emoji: '', country: 'North Mariana Islands (Saipan)' },
{ countryCode: '1 787', emoji: '🇵🇷', country: 'Puerto Rico' },
{ countryCode: '1 868', emoji: '🇹🇹', country: 'Trinidad and Tobago' },
{ countryCode: '1', emoji: '🇨🇦', country: 'Canada' },
{ countryCode: '1', emoji: '', country: 'Caribbean Nations' },
{ countryCode: '1', emoji: '🇺🇸', country: 'USA' },
{ countryCode: '20', emoji: '🇪🇬', country: 'Egypt' },
{ countryCode: '212', emoji: '🇲🇦', country: 'Morocco' },
@FeMaffezzolli
FeMaffezzolli / rf_guide.md
Last active May 12, 2021 18:41
Functional Requirements Guide

REQUISITOS FUNCIONAIS

Atributos de Um Requisito Funcional

Atributo Detalhe
Unidade O RF deve propor uma única coisa apenas. Não deve atender a mais de uma exigência. O RF “Incluir cliente” não é unitário, pois se refere a incluir clientes de tipos diferentes (pessoa física e jurídica), assumindo assim várias responsabilidades, quando deveria assumir apenas uma.
Completude O RF deve ser autocontido, deve ter “início/meio/fim”, ser completo. O RF “Pagar fatura” não é completo, só conta “parte da estória”. Para ser completo deveria ser algo como “Pagar fatura com cartão de crédito para cliente pessoa física”.
Consistência O RF não deve contradizer outro RF do mesmo escopo do projeto. É como termos dois RFs se propondo a fazer uma mesma coisa, mas cada RF se propondo a fazer esta coisa de uma forma diferente.
Atomicidade Um RF para ser atômico precisa também ter unidade, pois atomicidade remete a assumir apenas uma responsabilidade. Mas também deve ser algo indivisível,