Posts

Inspired

Edit videos with Premiere pro

Ecommerce NextJS Neon Postgres

 price and rating are strings in TS but they are Decimals in Postgres

Neon and vercel

npm i @neondatabase/serverless @prisma/adapter-neon ws  npm i -D @types/ws bufferutil

toFixed vs padEnd

  toFixed(2) → always returns exactly 2 decimal places and rounds (e.g. 1.235 -> "1.24", 1 -> "1.00"). Your current formatNumberWithDecimal → pads to at least 2 decimals but preserves extra digits (e.g. 1.235 -> "1.235", 1 -> "1.00"). //format number with decimal places export function formatNumberWithDecimal ( num : number ) : string {   const [ int , decimal ] = num . toString (). split ( '.' );   return decimal ? `${ int }.${ decimal . padEnd ( 2 , '0' ) }` : `${ int }.00` ; }

Prisma in next.js project setups

  npm i -D prisma @prisma/client npx prisma init npx prisma generate  npx prisma migrate dev --name init => create migrations and  tables npx prisma studio npx tsx ./db/seed (seed.ts) (must  import 'dotenv/config' so .env file can be seen )

C# fundamentals

int, double, decimal, string, char, bool are alias.  Do not compare floating point numbers for equality because of precision. Use Decimal instead. Must cast object-type object to proper type before being able to use its method. Can call it methods directly if it is dynamic-type object. (Ex: GetType, Length). Use with other language class libraries, or COM (Excel, Word). Value types variables are released while reference type variables must wait for garbage collection. var local variables can be inferred by suffixing literal values with L, M, D, F; a literal number, string, true/false. Value types can also use the new keyword if there is no literals to set the value. Ex: DateTime

min-h-screen in Tailwind CSS

min-h-screen in Tailwind CSS means: min-height: 100vh; So the element’s minimum height becomes the full height of the browser viewport. Example: <div class="min-h-screen bg-gray-100"> Content </div> This makes the <div> at least as tall as the screen. Common use cases: Full-page layouts Centering content vertically Sticky footer layouts Hero sections Example with centered content: <div class="min-h-screen flex items-center justify-center"> <h1>Hello</h1> </div> flex enables flexbox items-center centers vertically justify-center centers horizontally min-h-screen gives the container full screen height Difference from h-screen : Class Meaning h-screen exact height = screen height min-h-screen minimum height = screen height, can grow taller So if content becomes larger than the screen: h-screen may overflow min-h-screen expands naturally and is usually safer for pages https://chatgpt.com/s/t_6a07279539288191a9e55e3...