Skip to content

Instantly share code, notes, and snippets.

@djaffer
djaffer / tiktoken.js
Created July 19, 2024 04:17
Using Tiktoken WASM in React Environment Webpack
### To use tiktoken wasm in react for better performance. Hope it saves someone time due to poorly written guides.
### Follow this:
**This is for webpack 5. In weppack config override add. You can directly use wasm from js cdn as well. Skip this step if you want to use cdn.**
```
module.exports = (config, env) => {
config.experiments = {
@djaffer
djaffer / modifyAndroidManifestAttributes.js
Last active December 2, 2025 13:05
Modifying Android Manifest Attributes for Expo
const { withAndroidManifest } = require('@expo/config-plugins');
/**
Usage:
1. Create a dir named plugins at root of project where app.json is located
1. Add this file to your project (eg: ./plugins/modifyAndroidManifestAttributes.js)
2. In app.json use add this under expo attribute:
"expo"{
...,