Skip to content

Instantly share code, notes, and snippets.

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

Jamie Birch shirakaba

💭
🧙‍♂️
View GitHub Profile
@shirakaba
shirakaba / Dynamic linking on iOS.md
Created February 21, 2025 01:08
Dynamic linking on iOS
@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 / 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 [email protected], 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 / 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"
@shirakaba
shirakaba / Getting Biome to behave in a monorepo.md
Last active February 18, 2025 12:37
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 / I hate pip.md
Last active December 29, 2023 08:27
Fixing pip when even `pip --version` fails

A very common failure pattern of pip is the following:

> pip --version
/usr/local/bin/pip:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import load_entry_point
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/pkg_resources/__init__.py", line 631, in _build_master
    ws.require(__requires__)
  File "/opt/homebrew/lib/python3.11/site-packages/pkg_resources/__init__.py", line 968, in require
    needed = self.resolve(parse_requirements(requirements))
@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 / react-native-jsi-bridge-2+1.0.0.patch
Last active September 29, 2023 23:11
react-native-webview jsi patch
diff --git a/node_modules/react-native-jsi-bridge-2/ios/JsiBridgeEmitter.h b/node_modules/react-native-jsi-bridge-2/ios/JsiBridgeEmitter.h
index 62da923..cae7aee 100644
--- a/node_modules/react-native-jsi-bridge-2/ios/JsiBridgeEmitter.h
+++ b/node_modules/react-native-jsi-bridge-2/ios/JsiBridgeEmitter.h
@@ -9,16 +9,16 @@
#import <Foundation/Foundation.h>
#import "_JsiBridge.h"
-typedef void (^JsiBridgeCallback)(id data);
+typedef void (^CustomJsiBridgeCallback)(id data);
@shirakaba
shirakaba / Bun exiting without debug.md
Created September 24, 2023 02:46
Bun exiting without debug

We're going to be calling into Python from Bun, so ensure that you have Python 3 and Pip and install these packages for Python:

# https://github.com/polm/fugashi
pip install fugashi

# https://github.com/polm/unidic-py
pip install unidic
@shirakaba
shirakaba / UniDic Licence.txt
Last active August 9, 2023 01:42
UniDic fields
Copyright (c) 2011-2021, The UniDic Consortium
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.