Naming Things Better

There’s a section in the Electron docs on naming things that I thought was worth saving. If a module is a class or can be instantiated as one, name it using PascalCase If a module is a set of APIs or utils, name it using camelCase AirBnB also has a section on naming conventions which generally offers the same guidance. They go one step further and note that file names should exactly match the main export of that file: ...

February 16, 2025 · 1 min · 103 words · Me

VS Code SVG Extension

I spent 3-4 hours creating a Flutter app to edit and export SVGs only to find a VS Code extension that does both of these things in a few clicks. The extension is simply called SVG and it has almost 2 million downloads. The best part is that it allows you to edit SVGs directly in the editor and export them as PNGs. After installing the extension, right-click on one of your PNGs and select “Preview SVG” to start editing. This will open a new tab with the SVG preview and a toolbar at the top. In the toolbar, select the “Code interactive” button and click on any element in the SVG to start editing it. This will open a panel on the left with the SVG code. ...

February 11, 2025 · 1 min · 176 words · Me

Expressive Code in Astro Starlight

There are a lot of cool things you can do to code blocks using Expressive Code in Astro’s Starlight. Add File Names to Code Blocks ```js // my-title.js export default function MyTitle() { return <h1>My Title</h1> } ``` Add Titles to Code Blocks ```js title="my-title.js" export default function MyTitle() { return <h1>My Title</h1> } ``` Add Line Numbers to Code Blocks ```javascript {1} export default function MyTitle() { return <h1>My Title</h1> } ``` Combine diffing with Syntax Highlighting ```diff lang="js" function thisIsJavaScript() { // This entire block gets highlighted as JavaScript, // and we can still add diff markers to it! - console.log('Old code to be removed') + console.log('New and shiny code!') } ```

February 8, 2025 · 1 min · 114 words · Me