Skip to content

Instantly share code, notes, and snippets.

View diego3g's full-sized avatar
🚀
Launching a rocket

Diego Fernandes diego3g

🚀
Launching a rocket
View GitHub Profile
const layers = new sst.aws.Bucket('CodeconEncodingLayers')
const ffmpegLayer = new aws.s3.BucketObjectv2('FFmpeg', {
bucket: layers.name,
key: 'ffmpeg.zip',
source: new $util.asset.FileArchive('../../src/layers/ffmpeg.tar.gz'),
})
const lambdaLayer = new aws.lambda.LayerVersion('FFmpegLayer', {
s3Bucket: layers.name,
{
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"package.json": ".eslint*, prettier*, tsconfig*, vite*, pnpm-lock*, bun.lockb, nest*",
"tailwind.config.js": "tailwind.config*, postcss.config*",
".env.local": ".env*",
".env": ".env*"
}
}
@diego3g
diego3g / FileItem.tsx
Created June 22, 2023 17:40
Tailwind with Tailwind Variants Slots API
import { Button } from '@/components/Button'
import { CheckCircle2, Image as ImageIcon, Trash2 } from 'lucide-react'
import { useMemo } from 'react'
import { tv, VariantProps } from 'tailwind-variants'
const fileItem = tv({
slots: {
base: 'group flex items-start gap-4 rounded-lg border border-zinc-200 p-4',
icon: 'relative rounded-full border-4 border-violet-100 bg-violet-200 p-2 text-violet-600',
deleteButton: 'text-zinc-500 hover:text-violet-500',
@diego3g
diego3g / default
Last active February 25, 2023 09:36
{"name":"default","settings":"{\"settings\":\"{\\n \\\"emmet.syntaxProfiles\\\": {\\n \\\"javascript\\\": \\\"jsx\\\"\\n },\\n \\\"workbench.startupEditor\\\": \\\"newUntitledFile\\\",\\n \\\"editor.fontSize\\\": 16,\\n \\\"javascript.suggest.autoImports\\\": true,\\n \\\"javascript.updateImportsOnFileMove.enabled\\\": \\\"always\\\",\\n \\\"editor.rulers\\\": [\\n 80,\\n 120\\n ],\\n \\\"extensions.ignoreRecommendations\\\": true,\\n \\\"typescript.tsserver.log\\\": \\\"off\\\",\\n \\\"files.associations\\\": {\\n \\\".sequelizerc\\\": \\\"javascript\\\",\\n \\\".stylelintrc\\\": \\\"json\\\",\\n \\\"*.tsx\\\": \\\"typescriptreact\\\",\\n \\\".env.*\\\": \\\"dotenv\\\",\\n \\\".prettierrc\\\": \\\"json\\\"\\n },\\n \\\"screencastMode.onlyKeyboardShortcuts\\\": true,\\n \\\"cSpell.userWords\\\": [\\n \\\"bootcamp\\\",\\n \\\"chakra\\\",\\n \\\"checkin\\\",\\n \\\"checkins\\\",\\n \\\"clsx\\\",\\n \\\"Codegen\\\",\\n \\\"datadog\\\",\\n \\\"Datetime
@diego3g
diego3g / extensions.json
Last active October 16, 2024 17:30
VSCode Extensions
[
{
"identifier": {
"id": "vscode.bat"
},
"preRelease": false,
"version": "1.0.0"
},
{
"identifier": {
@diego3g
diego3g / seed.ts
Created January 16, 2023 19:45
Seed Prisma NLW Setup
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
const firstHabitId = '0730ffac-d039-4194-9571-01aa2aa0efbd'
const firstHabitCreationDate = new Date('2022-12-31T03:00:00.000')
const secondHabitId = '00880d75-a933-4fef-94ab-e05744435297'
const secondHabitCreationDate = new Date('2023-01-03T03:00:00.000')
name: Generate design tokens
on:
repository_dispatch:
types: update-tokens
jobs:
build:
runs-on: ubuntu-latest
steps:
import { createContext, ReactNode, useEffect, useState } from 'react'
type Theme = 'light' | 'dark';
type ThemeContextProviderProps = {
children: ReactNode;
}
type ThemeContextType = {
theme: Theme;
import { useState, createContext, useContext } from 'react'
// Lift state up -> Levantar o estado
// Context API
// Prop Drilling
type CartContextType = {
productsInCart: string[];
addProductToCart: (name: string) => void;
const teste = Teste();