Skip to content

Instantly share code, notes, and snippets.

import { gql, useMutation } from '@apollo/client';
import dynamic from 'next/dynamic';
import { array, object, string } from 'zod';
import { Form, useZodForm } from '../ui/Form';
import Modal from '../ui/Modal';
import TagSelection from './TagSelection';
import TechSelection from './TechSelection';
interface Props {
open: boolean;
setOpen: (open: boolean) => void;
import useFetchAllSnippets from '@/hooks/useFetchAllSnippets'
import Snippet from '@/types/Snippet'
import SnippetItem from '@/components/snippet/SnippetItem'
import React from 'react'
const SnippetList = () => {
const { snippets, isError, isLoading } = useFetchAllSnippets()
if (isError) return <div>failed to load snippets</div>
if (isLoading) return <div>loading snippets...</div>
import useFetchAllSnippets from '@/hooks/useFetchAllSnippets'
import Snippet from '@/types/Snippet'
import SnippetItem from '@/components/snippet/SnippetItem'
import React from 'react'
const SnippetList = () => {
const { snippets, isError, isLoading } = useFetchAllSnippets()
if (isError) return <div>failed to load snippets</div>
if (isLoading) return <div>loading snippets...</div>
import fetcher from "@/utils/fetcher";
import useSWR from "swr";
const useFetchAllSnippets = () => {
const { data, error } = useSWR("/api/snippet", fetcher);
return {
snippets: data,
isLoading: !error && !data,
isError: error
@28development
28development / command.txt
Created April 18, 2018 13:39
SCP command to copy a folder from a windows machine to an ubuntu machine
Copy the project "app" inside C:\laragon\www\ to the ubuntu server with the written location,
for security reasons one has to add the public key (.pem)
_____________________________________________________________________________________________
// Current dir in console has the .pem file
scp -r -i yourPublicKey.pem \laragon\www\app ubuntu@16.191.16.242:/home/bitnami/htdocs