Blog

Thoughts, stories, and updates.

Key Contributions to ai16z Eliza AI Project (Nov 2024)

Abstract: This post details significant enhancements made to the ai16z Eliza AI project in November 2024. The contributions focused on developing local-first capabilities by integrating BGE-Small and Ollama embeddings, optimizing the language model by upgrading to Claude 3 Haiku for better price-performance, and improving backend stability with fixes to Postgres...

Zustand: A Weapon for Efficient User State Management in React

Abstract: This post provides an overview of Zustand as an efficient state management library for React. It highlights Zustand’s benefits over traditional methods like refs and the Context API for managing user state, focusing on how it simplifies code, minimizes re-renders, and offers a more flexible approach to global state,...

Optimizing React Authentication: Minimizing Re-renders and Improving Performance

Abstract: This post offers a guide to minimizing re-renders and optimizing performance in React/Next.js applications, particularly those with authentication. It covers practical techniques such as combining state variables, memoizing context values with useMemo, tracking significant state changes with useRef, debouncing frequent updates, and carefully managing useEffect dependencies to prevent unnecessary...

Conditional Rendering in Next.js: Hiding Footer on Specific Pages

Abstract: This post provides a guide to conditionally rendering components, such as a footer, within a Next.js 14 application using the App Router. It details a solution for hiding components on specific pages by bridging server and client components through the React Context API and the usePathname hook, addressing challenges...

Integrating with Shadcn: Tips and Insights for Seamless UI Component Integration

Abstract: This post shares a developer’s experience integrating Shadcn UI components into a Next.js project. It covers essential aspects such as initial project preparation, adapting to Shadcn’s opinionated styling (including dark theme and “New York” style), managing global CSS to avoid conflicts, and provides an example root layout that incorporates...

Securing SSH: A Detailed Look at Fail2Ban Configuration and Rule Management

Abstract: This post provides a detailed guide to troubleshooting and configuring Fail2Ban with UFW for robust SSH security on Linux servers. It covers common issues like incorrect iptables rule order, proper jail.local setup for SSH, considerations for persistent bans, and the importance of ensuring correct cleanup of iptables rules when...

Navigating UI Framework Transitions: From Bootstrap to Shadcn

Abstract: This post reflects on a developer’s journey through UI framework choices, transitioning from Bootstrap to a Next.js and Tailwind CSS stack, and ultimately deciding to integrate Shadcn/ui. It discusses the pros and cons of using component libraries like Shadcn, which are based on Radix UI and involve copying code,...

Navigating Client vs Server-Side Authentication in Web Development

Abstract: This post explores the differences between client-side and server-side authentication flows when using Supabase with Next.js 14 (App Router). It provides practical examples covering Google OAuth2 social login, which typically uses a client-side flow with createBrowserClient, and Magic Link email authentication, which involves a server-side flow using createServerClient. The...

Implementing Auth and Database for 8-Bit Oracle

Abstract: This post details the initial backend setup for the 8-Bit Oracle project, focusing on authentication and database integration using Next.js, Supabase (with Auth-UI for OAuth2 and Magic Links), and Tailwind CSS. It discusses the rationale behind choosing Supabase over Firebase, the decision to defer Web3Auth integration, and announces the...

Claude vs GPT4 for Coding

Abstract: This post offers a developer’s brief comparison of using Claude Opus and GPT-4 (via Cursor.sh) as AI coding assistants. It highlights experiences with both models, particularly when working with Next.js (App Router vs. Pages Router) and how they handle recent framework updates, noting differences in understanding context and relevance...