My Learning Curve

Feed

Phil Nash

Latest entries from Phil Nash.

Source: https://philna.sh/

5 quick tips for giving better presentations

Mar 5, 2026

I have been speaking publicly at developer conferences for over a decade and in that time I've seen plenty of other people giving talks. Everyone gives talks differently, and if yo...

How wrong can a JavaScript Date calculation go?

Jan 11, 2026

The Date object in JavaScript is frequently one that causes trouble. So much so, it is set to be replaced by Temporal soon. This is the story of an issue that I faced that will be ...

How to Create Vector Embeddings in Python

Apr 8, 2025

When you’re building a retrieval-augmented generation (RAG) app, the first thing you need to do is prepare your data. You need to: collect your unstructured data split it into chun...

Shallow clones versus structured clones

Dec 30, 2024

Have you ever had one of those times when you think you're doing everything right, yet still you get an unexpected bug in your application? Particularly when it is state-related an...

How to Create Vector Embeddings in Node.js

Sep 25, 2024

When you’re building a retrieval-augmented generation (RAG) app, job number one is preparing your data. You’ll need to take your unstructured data and split it up into chunks , tur...

JavaScript is getting array grouping methods

Sep 14, 2023

Grouping items in an array is one of those things you've probably done a load of times. Each time you would have written a grouping function by hand or perhaps reached for lodash's...

Node.js includes built-in support for .env files

Sep 5, 2023

With the recent release of version 20.6.0 , Node.js now has built-in support for .env files. You can now load environment variables from a .env file into process.env in your Node.j...

How to use the Bitly API in Ruby

Nov 9, 2022

Link shortening has been around for a long time and Bitly is arguably the king of the link shorteners. It has support for shortening long URLs as well as custom short links, custom...

How to stream file downloads in Node.js with Got

Aug 6, 2020

Got is a Node.js library for making HTTP requests . It has both promise and stream based APIs and in this post I want to explore how to use the stream API to download files. Using ...

I built a VSCode extension: ngrok for VSCode

Apr 14, 2020

Over the Easter weekend, a four day weekend characterised by lockdowns all over the world, I decided to use the extra time I had at home to start a new project and learn a new skil...

Making a responsive Twitch Embed

Mar 23, 2020

I've been trying out streaming live code on Twitch which is a lot of fun. I wanted to share on my own site that I was streaming so I have built a page dedicated to it . The page wi...

The story of a mildly popular Ruby gem

Mar 17, 2020

The list on GitHub of repositories that depend on your repository is scary. There's something nice about writing and releasing a library, module, Ruby gem, whatever. It is code tha...

How to find CFPs for developer conferences

Jan 29, 2020

So you've decided to speak at a developer conference? You have a story you want to share with your peers—how you built something, how you learned something new, how you became a be...

Testing signed and encrypted cookies in Rails

Jan 15, 2020

Recently I've been refactoring the tests for a gem I maintain and I needed to test that it sets the right cookies at the right time. But the cookies in use in the gem are signed co...

How not to sort an array in JavaScript

Aug 26, 2019

Array sorting is one of those things you don't spend too long thinking about, until it stops working for you. Recently I was working with array of items in JavaScript that were not...

How to start a Node.js project

Jan 10, 2019

Sometimes I write blog posts to remind myself what I've learned and sometimes I write them because someone else shares something and I want to remember that better. This post is on...

2018 in review

Jan 3, 2019

I've never been one for writing a review of my year. This year I've found myself not only reading, but comparing myself to others' reviews. I realised that this is not particularly...

Service workers: beware Safari's range request

Oct 23, 2018

You've implemented a service worker to cache some assets. Everything is working well, your service worker is a success, you're feeling good. But then... Some time passes and you de...

Techniques for animating on the canvas in React

Sep 27, 2018

I recently experimented with audio visualisation in React on the Twilio blog . While I meant to teach myself more about the web audio API I found that I picked up a few techniques ...

Implementing one time passwords in Crystal

Sep 4, 2018

Crystal is still a young language, there aren't a lot of libraries available yet. For some this could be offputting, but for others this is a chance to learn about a language and p...

Git commands to keep a fork up to date

Aug 21, 2018

I've seen the following tweet about git making its way around Twitter recently: I ❤️ Git. But honestly, it intimidated me for years. I thought I needed to understand all its powerf...

Spring clean your dev machine

May 27, 2018

Development machines can build up such a lot of cruft. Old versions, oudated programs and unused caches litter the hard drive. It's good to take time once in a while to clean all o...

Use the web share API easily with web components

Apr 25, 2018

I'm a fan of the web share API but I was not happy with my initial implementation of the API . It was all a bit complex for what is a very simple API. I wanted something more decla...

gzip a file in Ruby

Feb 25, 2018

At the start of the year I looked into how to better compress the output of a Jekyll site. I'll write up the results to that soon. For now, here's how to gzip a file using Ruby. En...

Permissions on the web suck

Jan 8, 2018

I am a fan of progressive web apps and the powers that they bestow on web developers to build the next generation of applications. We can write web applications that work offline, ...

Experimenting with the background fetch API

Jul 4, 2017

The service worker API is expanding as more ways to use the background dwelling worker emerge. I've written before about push notifications and background sync and I recently explo...

Speed up bundle install with this one trick

Jun 12, 2017

Did you know bundler can download and install gems in parallel? That's right, using the --jobs option for bundle install means you can set the number of gems that can download and ...

Always install Bundler alongside Ruby with rbenv

Mar 22, 2017

Here's a quick tip for anyone who uses rbenv and ruby-build to manage installing and switching Ruby versions. When installing a new version of Ruby I cannot think of a situation in...

The web share API

Mar 14, 2017

Recently I implemented the web share API for my site as a means of testing it out. If you are using version 55 or above of Chrome on Android then you can see it in action by clicki...

Doing things wrong

Feb 13, 2017

I wrote a blog post last week and bits of it were wrong. This is not a retraction of that blog post, I just wanted to share the feedback that I got, the things I changed and some l...

A toast to ES2015 destructuring

Feb 9, 2017

I think the ES2015 destructuring syntax is pretty cool. It might not grab the headlines like Promises, Generators or the class syntax, but I find it really useful. It's also surpri...

On fixing a favicon

Jan 27, 2017

Sometimes open source work is just fixing one tiny thing that bugs you. However, rolling up your sleeves and delving into even the smallest amount of code can lead to surprising re...

Git back to the future

Jan 4, 2017

Git may be the best version control software I've used but it is a complex beast and makes it easy to shoot yourself in the foot. Recently, however, I learned of one way that you c...

A community offers to help

Sep 5, 2016

Last week I was blown away by the response to a problem I was experiencing from maintainers of two of the larger open source projects in the Ruby world. And not just your average l...

Install a service worker declaratively

Aug 17, 2016

There's been some interesting updates in service workers recently. The big news is that the Microsoft Edge development version now has service workers, alongside push notifications...

August is iOS month

Aug 1, 2016

June saw me ask for your help as I started to learn Swift. July was busy with travel. Now August is iOS month. I'm lucky that part of my job as a developer evangelist for Twilio is...

Creating an asset pipeline with Jekyll-Assets

Jun 28, 2016

When I started again on this site, I wanted to make sure it was going to load fast. Performance matters . Bundling, minifying and caching the static assets was high on the priority...

Critique my Swift on Exercism

Jun 20, 2016

I am currently in the middle of a Swift and iOS course with the excellent Big Nerd Ranch . Taking a week to dedicate to learning a new language and framework means I can block out ...

The surprise multipart/form-data

Jun 13, 2016

Building up and sending an Ajax request is so much easier than it ever used to be. No longer must we hassle ourselves with XMLHttpRequest , never mind the horror of ActiveX's Activ...

This site isn't finished

May 18, 2016

No running site is ever completely finished. This one is no exception. There is more to build, more to style and more to write. It's a challenge. Welcome to the new version of my s...