Featured post
Read moreRefraction has been acquired by Twistag
I'm super excited to announce that earlier today, Refraction was acquired by
Twistag — a Lisbon based design and software agency who focus on delivering
amazing digital products.
Powered by OpenAI, Refraction is a suite of tools for developers to ge
2024
Simulating Row-Level Security in MySQL with Clerk and Prisma
Row-level security (RLS) is a popular PostgreSQL concept where tables can have
row security policies that restrict, on a per-user basis, which rows can be
returned by normal queries or inserted, updated, or deleted by data modification
commands.
Unf
Oct 9, 2024 • 5 min readSecure Linear OAuth2 flow with Next.js and React Server Components
Normally I don't take time out to write about something as well documented as
OAuth2, but I was so impressed with how easy it was to build a custom OAuth2
flow with Next.js and React Server Components that I had to share it.
I'm going to run you thr
Mar 10, 2024 • 11 min read2023
Neutral is shutting down
It's been an incredibly rewarding journey for me to help you plant 4613 trees
around the world. Together, we have planted a forest - not just of trees but of
hope and unified action towards a healthier world. Every tree planted and every
ounce of car
Sep 5, 2023 • 3 min readStreaming OpenAI completions with the Vercel Edge Runtime
I recently built an AI-powered development tool (Refraction) using the OpenAI
API. I was really impressed with the results of OpenAI and Vercel, so I wanted
to share how I built both tools in less than 2 days.
One of the key components of this build
Jan 14, 2023 • 12 min readMaking react-syntax-highlighter "editable"
The React library react-syntax-highlighter package is a handy little utility for
highlighting code snippets. It supports a wide variety of languages and has a
bunch of different themes. While it's very easy to use, it has one major
drawback: it's not
Jan 13, 2023 • 5 min read2022
Enabling HSTS Preload in Next.js
HSTS stands for HTTP Strict Transport Security, and it is a security measure
that helps protect against man-in-the-middle attacks by ensuring that a web
browser can only connect to a website using a secure HTTPS connection. When a
website has HSTS en
Dec 8, 2022 • 4 min readReplacing JS Libraries with Intl
JavaScript is a versatile language that is used in many web applications to add
interactivity and dynamic features. To help developers work with dates and
times, there are several popular libraries such as Moment.js and date-fns. These
libraries prov
Dec 7, 2022 • 6 min readUsing clsx with Tailwind CSS for element style composition
Tailwind is a utility-first CSS framework that makes it easy to quickly create
well-designed pages without having to work with CSS files or write rules from
scratch. One of the key features of Tailwind is that it uses utility classes,
which are short
Dec 3, 2022 • 4 min readHandy Body and Error Parsing Utilities for Next.js
When dealing with requests and errors in Next.js API routes, we want to make
sure that we are handling them in a way that is consistent and predictable.
Unfortunately, we're not always given great typings for free and sometimes we
have to do a little
Dec 1, 2022 • 5 min readWhy Figma's AutoLayout system is brilliant for writing code
The AutoLayout system in Figma is a tool that helps designers to create flexible
and responsive layouts for their designs. It allows designers to specify
constraints for the position and size of elements within a layout, and then
automatically adjust
Nov 30, 2022 • 4 min readOptimizing your Next.js personal website's SEO with next-seo
The next-seo library is a powerful tool for optimizing the technical SEO of a
Next.js website. The library offers a range of components that can be used to
improve the search engine visibility and parsing of a website. In this post,
we'll explore fiv
Nov 27, 2022 • 7 min readCreating active link class modifiers with Tailwind and Next.js 13
An active class wrapper is a way to add a special class to an HTML element when
the link matches the current page, which is useful for highlighting a menu item
in a navbar. While this is common practice, it becomes slightly more interesting
to execut
Nov 25, 2022 • 6 min readOptimizing Next.js images for speed and quality
Next.js's built-in image component (next/image) provides a simple and efficient
way to handle responsive images in your Next.js app. It's a wrapper around the
standard HTML <img> element with added features and functionality specifically
tailored for
Nov 22, 2022 • 5 min readCreating a no-auth Spotify playlist preview with Next.js
I've been spending a lot of time on Spotify lately and wanted to share some of
my playlists on the web. But just linking out to the playlist didn't feel right,
so I spent some time messing around with the Spotify API to see what was
actually possible
Apr 2, 2022 • 18 min readStripe PaymentSheet subscriptions with Apple / Google Pay on Expo and Firebase
Okay so I know the title is a bit of a mouthful but today's post is actually
pretty neat - we're putting together a full, end-to-end Stripe subscription flow
in our Expo app with Firebase. We're going to use PaymentSheet to handle the
checkout experi
Jan 29, 2022 • 14 min readImplementing Push Notifications with Expo and Firebase Cloud Functions
Today we're going to implement Push Notifications in an Expo app using Firebase
Cloud Functions - how exciting! Despite how complex Expo's diagrams appear, it's
actually remarkably simple to add Push Notifications to your app!
Let's get started.
D
Jan 29, 2022 • 9 min readImplementing a smart analytics hook for Firebase and Amplitude in Expo 44+
In today's show, we're creating a smart analytics hook for Firebase Analytics
and Amplitude using Expo!
What does "smart" mean? I'm glad you asked! It means:
1. It allows us to send a single event to both platforms concurrently and
consistentl
Jan 28, 2022 • 23 min readImplementing a simple OTA update function with Typescript and Expo 44+
I'm currently migrating away from Expo's OTA updates to purely store-managed EAS
updates to simplify my development workflow and noticed I'd written a handy
script I could share for handling OTA updates.
Overview
To preface - Expo have a handy exp
Jan 28, 2022 • 6 min read2021
Neat User and Profile React Hooks for Firebase V9
For a good while, I've been relying on a little package called
react-firebase-hooks to turn my Firebase realtime document fetching into tidy
hooks. However, this library has become a bit sketchy since the release of
Firebase v9 a.k.a the Modular edit
Dec 24, 2021 • 6 min readImplementing Google and Apple login hooks with Expo 43 and Firebase v9
I'm starting on a new mobile project this weekend and decided to implement my
auth system properly this time, using neat hooks and a credential-based social
login system.
Our tech stack for this project will include React Native, Expo 43 (which came
Oct 23, 2021 • 15 min readFinding a user's friends in their Contacts with Firebase and Expo
I'm currently building an app that runs of phone numbers as the primary
authentication method, then lets you add friends by allowing access to your
contacts list.
While this sounds pretty straightforward, it's actually pretty hectic once you
get int
May 18, 2021 • 9 min readUpload images to Firebase using Expo 39+ managed workflow
Typically, uploading images to Firebase using the JavaScript SDK is pretty
straightforward. All we need to do is create a root reference to our storage:
// Get the local file
const file = fetch('...');
// Create a root reference
const storageRef =
May 18, 2021 • 4 min readUsing the Firebase Local Emulator with Expo's managed workflow
Firebase is Google's mobile platform that helps you quickly develop high-quality
apps and grow your business. They acquired it in 2014 and now use it as their
flagship offering for app development. It's essentially a high-level UI and SDK
that sits o
May 18, 2021 • 6 min readJoin 2,0002,000 readers and get infrequent updates on new projects.
+2.2K