Skip to content

Instantly share code, notes, and snippets.

View shirakaba's full-sized avatar
💭
🧙‍♂️

Jamie Birch shirakaba

💭
🧙‍♂️
View GitHub Profile
@shirakaba
shirakaba / Getting Biome to behave in a monorepo.md
Last active April 4, 2025 07:39
Getting Biome to behave in a monorepo

How to get Biome to behave in a monorepo

At the time of writing, namely v1.8.3, Biome does not fully support monorepos yet, but you can wrestle it into working.

Below, we have a typical monorepo (with the changes we're about to make marked in green). It has some workspaces under apps and packages, and at each level of the repo, there are a mixture of files we want to format or ignore.

  .
  ├── .gitignore
+ ├── .vscode
@shirakaba
shirakaba / README.md
Last active March 27, 2025 15:25
GUI-based debugging of iOS/macOS Rust projects in Xcode

Here's how to get your environment set up to:

  1. Develop iOS and Android apps using Rust.
  2. Enable GUI debugging of Rust projects in Xcode.

If you just want to enable GUI debugging of macOS Rust projects in Xcode, I'm not actually sure whether you need cargo-mobile at all. But one benefit of installing it is that it automatically installs rust-xcode-plugin for you, giving you syntax highlighting of Rust sources in Xcode.

Prerequisites

cargo-mobile

@shirakaba
shirakaba / Dynamic linking on iOS.md
Created February 21, 2025 01:08
Dynamic linking on iOS
@shirakaba
shirakaba / setup.md
Last active February 7, 2025 20:29
Configuring Nexus as a private registry for npm packages

Get the details to connect to your Nexus-managed npm repository

Note: Nexus group repositories (good example in this StackOverflow question) are out of this tutorial's scope. In any case, deployment to group repositories is currently still an open issue for Nexus 3 (and not intended ever to be implemented in Nexus 2). Thus, it is assumed that we'll push & pull to/from the same repository, and ignore the idea of groups hereon in.

  1. Ask your sysadmin for a username & password allowing you to log into your organistation's Nexus Repository Manager.

  2. Test the login credentials on the Nexus Repository manager at: http://localhost:8081/nexus/#view-repositories (localhost in our case is replaced by a static IP, and can only be connected to over VPN). If your organisation requires a VPN to connect to it, connect to that VPN before proceeding with this tutori

@shirakaba
shirakaba / nix.md
Last active December 26, 2024 21:01
Setting up Nix and Home Manager on a new M1 Mac (circa Dec 2021)

Background

I have a brand new M1 MacBook Pro. I have a long list of complaints with homebrew, so I want to try Nix as my package manager instead, along with Home Manager to control my setup on a per-user basis. Once I've set this all up, theoretically, I should be able to reuse the same configuration on any other Macs I own.

What is Nix?

A reproducible, declarative package manager.

More info:

@shirakaba
shirakaba / vite-configuration.md
Last active November 18, 2024 03:50
How to configure Vite from svelte.config.js in SvelteKit projects

SvelteKit

In SvelteKit projects, SvelteKit wraps around Vite.

This example is for configuring path aliases, but you get the idea. There's a kit.vite property in svelte.config.js, and you'd configure vite through there.

https://kit.svelte.dev/faq#aliases

Vite's plugins should be API-compatible with Rollup, to my understanding.

@shirakaba
shirakaba / React Native Windows and React Native macOS handbook.md
Last active October 30, 2024 05:31
React Native Windows and React Native macOS handbook

How to init a project

⚠️ As the original react-native-windows-init command is to be deprecated from react-native-windows@0.75, we should now use init-windows, even for generating projects using earlier versions.

See the new init-windows command in their @next docs.

Usage

The command expects to be run inside an existing React Native project, so run steps 1-2 (as per the docs) if starting from scratch.

@shirakaba
shirakaba / gist:85297b286c7c4fd6097c2e2c49d8ff1e
Last active October 15, 2024 23:13
Setting up deDRM with Calibre

Go to apprenticeharper/DeDRM_tools and download the latest release.

Follow the plugin's installation instructions:

Open calibre's Preferences dialog. Click on the "Plugins" button. Next, click on the button, "Load plugin from file". Navigate to the unzipped DeDRM_tools folder, find the file "DeDRM_plugin.zip". Click to select the file and select "Open". Click "Yes" in the "Are you sure?" dialog box. Click the "OK" button in the "Success" dialog box.

Once the DeDRM plugin appears in the Calibre plugins menu, double-click it to get the Customise DeDRM popup. From there, click "eInk Kindle ebooks".

Add the serial number for your preferred Kindle (the one you intend to download files for) via the Manage Your Content and Devices section of the Amazon site (instructions here).

@shirakaba
shirakaba / Setting up Windows to be friendly for Mac developers.md
Last active September 16, 2024 08:22
Setting up Windows to be friendly for Mac developers

The unofficially redistributed official Apple Bootcamp USB drivers didn't seem to do anything for my new Apple Magic Keyboard.

winkbdlayouts provided me a UK Apple layout. It's not perfect (tilde and backtick are swapped, for one thing), but it does get most keys. Initially, it didn't seem to have installed properly, so I ended up editing the registry keys to remap the default UK keyboard to the Apple one, but later I found that I'd simply needed to restart the computer to re-read the registry keys.

Update: I actually find no difference between the custom United Kingdom Apple (WKL) layout and the ready-installed English (United Kingdom) layout. Waste of time.

I didn't end up buying kbdedit, but it helped me understand the layout of things.

Another thing to try would've been [Magic Utilities](https://magicutilities.n

@shirakaba
shirakaba / Changing timestamp on commit.md
Created July 12, 2024 03:43
Changing timestamp on commit
# Interactively rebase the current branch onto `main`
git rebase -i main

Modify the commit dates of first commit and second commit but leave third commit unchanged.

pick c40f82d first commit
exec git commit --amend --no-edit --date "Wed Jul 10 08:30:00 2024 +0900"