Skip to content

Instantly share code, notes, and snippets.

@Randall71
Randall71 / WithPhotoEditor.js
Created June 27, 2025 10:09
Config plugin for @thienmd/react-native-image-editor or the old react-native-photo-editor package
const fs = require('fs');
const path = require('path');
const { withAndroidManifest, withDangerousMod } = require('@expo/config-plugins');
// Function to modify the iOS Podfile properly inside the target block
function modifyPodfile(config) {
return withDangerousMod(config, [
'ios',
async (config) => {
const podfilePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');
@Randall71
Randall71 / @thienmd+react-native-image-editor+0.7.0.patch
Last active June 27, 2025 09:48
@thienmd/react-native-image-editor patch with React Native 0.79
diff --git a/node_modules/@thienmd/react-native-image-editor/android/build.gradle b/node_modules/@thienmd/react-native-image-editor/android/build.gradle
index 603a049..32ee677 100644
--- a/node_modules/@thienmd/react-native-image-editor/android/build.gradle
+++ b/node_modules/@thienmd/react-native-image-editor/android/build.gradle
@@ -44,12 +44,18 @@ repositories {
dependencies {
implementation 'com.facebook.react:react-native:+'
- implementation 'com.github.prscX:photo-editor-android:master'
- implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
@Randall71
Randall71 / WithAbiFilters.js
Created June 20, 2025 18:08
Config Plugin to just build expo app for specific architectures of processor (armeabi-v7a, arm64-v8a, x86, x86-64)
const { withGradleProperties, withAppBuildGradle } = require('@expo/config-plugins');
const withAbiFilters = (config, { abiFilters = ['arm64-v8a'] } = {}) => {
console.log('🔧 ABI Filter plugin is running!', abiFilters);
// Set gradle.properties
config = withGradleProperties(config, (config) => {
// Convert array to comma-separated string for gradle.properties
const architecturesString = abiFilters.join(',');
@Randall71
Randall71 / increment-version.sh
Last active June 24, 2025 09:16
The purpose of this Bash script is to use semver to simplify the process of incrementing the version, versionCode, and buildNumber of an Expo app.
#!/bin/bash
# ANSI color codes
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No color
# Emoji icons
STARTING_ICON="🎇"
SUCCESS_ICON="✅"