Skip to content

Instantly share code, notes, and snippets.

View shirakaba's full-sized avatar

Jamie Birch shirakaba

View GitHub Profile
shirakaba /
Last active May 16, 2024 13:57
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 / I hate
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
  from pkg_resources import load_entry_point
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/pkg_resources/", line 631, in _build_master
  File "/opt/homebrew/lib/python3.11/site-packages/pkg_resources/", line 968, in require
    needed = self.resolve(parse_requirements(requirements))
shirakaba / gist:85297b286c7c4fd6097c2e2c49d8ff1e
Last active December 27, 2023 11:43
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 "". 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 / Creating an Expo app in
Created July 12, 2023 08:08
Creating an Expo app in 2023

Creating an Expo app in 2023

12th July, 2023. I'm going to try creating an iOS app called Paranovel, using Expo. My environment for mobile app dev (Xcode, Ruby, etc.) should be in reasonably good shape already as I frequently develop with React Native and NativeScript.

Creating the app

Go to, and see the Quick Start: npx create-expo-app paranovel

This runs with no problem, then I get this macOS system popup:

shirakaba /
Last active November 17, 2023 00:52
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.



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 / Bun exiting without
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:

pip install fugashi

pip install unidic
shirakaba / How NativeScript's JS->native bindings
Last active August 22, 2023 10:44
How NativeScript's JS->native bindings work

[Draft] Deep-dive: How NativeScript's JS->native bindings work

What is NativeScript?

NativeScript is a JavaScript runtime that allows you to write an iOS or Android app entirely in TypeScript or JavaScript with no compromises. That is to say, it provides you with the same level of native access that writing the app in Obj-C/Swift (for iOS) or Java/Kotlin (for Android) does. Not just JSON-serialisable data types like NSString, but all data types are supported. To illustrate what it's all about, here's how you would get the battery level using NativeScript (the below snippet is entirely JS code!):

import { isIOS, isAndroid, Application } from "@nativescript/core";

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
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
shirakaba /
Last active July 8, 2023 03:19
How to configure Vite from svelte.config.js in SvelteKit projects


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.

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