Skip to content

Instantly share code, notes, and snippets.

@edoves
edoves / readme.md
Last active December 9, 2024 14:24
HTML EMAIL

Responsive

<!DOCTYPE html>
<html lang="en" xmlns="https://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="x-apple-disable-message-reformatting">
    <title></title>
@edoves
edoves / g.md
Created December 4, 2024 09:50

What are Visual Elements that combine to create Graphic Design?

Graphic design relies on a set of visual elements that, when combined, create compelling and effective compositions. These elements are the building blocks of any design and work together to convey messages, evoke emotions, and achieve specific goals. Here are the core visual elements:


1. Line

  • Definition: A line connects two points and can be straight, curved, dashed, or irregular.
  • Purpose: Defines boundaries, guides the viewer's eye, creates patterns, or conveys movement.

Git Notes

  • git fetch
@edoves
edoves / 1readme.md
Last active November 29, 2024 08:48

ReactJS Component

  • Heading Tag(dynamic)
  • Img Tag
@edoves
edoves / server_action_manual_validation.md
Last active November 19, 2024 13:34
Server Action with manual validation

Server Action with manual validation

Video Source

textarea.jsx

'use client';

import { useState } from 'react';
@edoves
edoves / src_utils_supabase_middleware.md
Last active November 15, 2024 05:21
src/utils/supabase/middleware.ts

Supabase Middleware public and private route

import { createServerClient } from '@supabase/ssr';
import { NextResponse, type NextRequest } from 'next/server';

export async function updateSession(request: NextRequest) {
  try {
    let supabaseResponse = NextResponse.next({
      request,
@edoves
edoves / 1sql_stored_function.md
Last active November 11, 2024 03:59
PostgreSQL Stored Function

PostgreSQL Stored Function

create or replace function post_todo() 
returns setof table_sample as $$
begin
    -- SQL statements go here
end;
$$ language plpgsql;

Neon and Supabase are both platforms that utilize PostgreSQL databases but cater to different development needs. Here's a comparison to help you understand their distinctions:

Neon: Serverless PostgreSQL

  • Architecture: Neon separates compute and storage, offering a serverless PostgreSQL experience with features like autoscaling and the ability to scale to zero during inactivity.

  • Features:

    • Branching: Supports instant database branching, facilitating efficient development workflows.
    • Auto-Scaling: Automatically adjusts resources based on demand, enhancing cost efficiency.
  • Compatibility: Maintains high compatibility with standard PostgreSQL, ensuring seamless integration with existing tools and applications.

@edoves
edoves / 1api_layer.md
Created November 6, 2024 01:20
Two API layer Explanation

API layer 1

Explanation

When you work with third-party services or external APIs (like weather services, payment gateways, or any other external data source), they often provide you with an API key or some form of authentication. This key is sensitive information—like a password—that allows access to the service.

If you’re fetching data directly from the client side (for instance, a React or Vue application running in the user's browser), you would need to expose this API key to make calls to the third-party service. However, if this key is visible in the client code, anyone who views your client-side code could potentially see and misuse it.

To protect this sensitive information, it’s best practice to create a server-side API layer. This means:

Edited tailwind nav source

 <nav className="bg-gray-800">
      <div className="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8">
        <div className="relative flex h-16 items-center justify-between">
          <div className="flex flex-1 justify-start">
            {/*logo*/}
            <div className="flex flex-shrink-0 items-center">
              <img
                className="h-8 w-auto"