Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🚀

Fábio Vedovelli vedovelli

💭
🚀
View GitHub Profile
@vedovelli
vedovelli / db.server.ts
Created Sep 23, 2022
Remix Prisma DB server
View db.server.ts
// @ts-nocheck
import { PrismaClient } from '@prisma/client';
let db: PrismaClient;
declare global {
let __db: PrismaClient | undefined;
}
// this is needed because in development we don't want to restart
View Vedovelli VSCode extensions 2022.txt
2gua.rainbow-brackets
adampalhazi.vscode-debug-arrow-function
alexcvzz.vscode-sqlite
alfnielsen.vsc-organize-imports
aliariff.auto-add-brackets
andys8.jest-snippets
antfu.iconify
antfu.vite
apollographql.vscode-apollo
arcticicestudio.nord-visual-studio-code
View Vedovelli VSCode settings.json
{
"git.enableSmartCommit": true,
"workbench.editor.decorations.colors": true,
"editor.minimap.enabled": false,
"editor.accessibilitySupport": "off",
"zenMode.hideLineNumbers": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"tailwindCSS.includeLanguages": {
"typescriptreact": "html",
"plaintext": "html",
View index.tsx
import type { LoaderFunction, ActionFunction } from "remix";
import { useLoaderData, useFetcher } from "remix";
import invariant from "tiny-invariant";
import cuid from "cuid";
import React from "react";
import type { Task, User } from "@prisma/client";
import { requireAuthSession } from "~/util/magic-auth";
import { ensureUserAccount } from "~/util/account";
import { placeCaretAtEnd } from "~/components/range";
import { getBacklog } from "~/models/backlog";
@vedovelli
vedovelli / Products.js
Last active Nov 29, 2021
Screencast Storybook
View Products.js
import { http } from "../../service/api";
import { Card } from "./Card";
import { Header, Spinner } from "../../components";
import { useQuery } from "react-query";
export default function Products() {
const { isLoading, isError, data } = useQuery(
"todos",
() => http.get("/products").then(({ data }) => data.products) // http contains baseURL with `/api`
);
View Products.js
import { http } from "../../service/api";
import { Card } from "./Card";
import { Header, Spinner } from "../../components";
import { useQuery } from "react-query";
export default function Products() {
const { isLoading, isError, data } = useQuery(
"todos",
() => http.get("/products").then(({ data }) => data.products) // http container baseURL with `/api`
);
View factory-poc.js
import {mount, createLocalVue} from '@vue/test-utils';
import Vuetify from 'vuetify';
export function factory (component, propsData) {
const vuetify = new Vuetify();
const localVue = createLocalVue();
return mount(component, {
propsData,
localVue,
View vitor.code-workspace
{
"folders": [
{
"path": "."
}
],
"settings": {
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#007c27",
"titleBar.activeForeground": "#ffffff",
View Cypress-Mirage-config.js
Cypress.on("window:before:load", win => {
win.handleFromCypress = function(request) {
return fetch(request.url, {
method: request.method,
headers: request.requestHeaders,
body: request.requestBody
})
.then(res => {
return new Promise(resolve => {
res.json().then(body => {
View vedovelli-vsc-snipperts.json
{
"Vue Simple Component": {
"scope": "vue",
"prefix": "vsc",
"body": [
"<script>",
"export default {",
" name: '$1',",
"};",
"</script>",