Skip to content

Instantly share code, notes, and snippets.

View cristiangu's full-sized avatar

Cristian Gutu cristiangu

View GitHub Profile
@cristiangu
cristiangu / refresh_ipa_js_bundle.rb
Created March 29, 2025 12:51
Update an IPA file with a new React Native JS bundle
module Fastlane
module Actions
module SharedValues
REFRESH_IPA_JS_BUNDLE_CUSTOM_VALUE = :REFRESH_IPA_JS_BUNDLE_CUSTOM_VALUE
end
class RefreshIpaJsBundleAction < Action
def self.run(params)
require 'fastlane/actions/resign'
unzipped_path = "./ipa_unzipped"
@cristiangu
cristiangu / config.yml
Last active March 29, 2025 13:33
A set of CircleCI commands to use when recycling IPA/APK build for React Native
version: 2.1
commands:
restore-ios-ipa-cache:
parameters:
env:
type: enum
enum: ['staging', 'prod']
steps:
- restore_cache:
@cristiangu
cristiangu / install-tools-android.sh
Created March 29, 2025 08:59
Install wget, yq, apktool and bundletool
# Install wget
apt update -qq && apt install -qq -y --no-install-recommends wget
# Install yq
version=v4.45.1
binary=yq_linux_amd64
wget https://github.com/mikefarah/yq/releases/download/${version}/${binary}.tar.gz -O - |\
tar xz && mv ${binary} /usr/bin/yq
# Install apktool
@cristiangu
cristiangu / refresh_apk_js_bundle.rb
Last active March 29, 2025 12:49
Update an APK file with a new React Native JS bundle
module Fastlane
module Actions
module SharedValues
REFRESH_APK_JS_BUNDLE_CUSTOM_VALUE = :REFRESH_APK_JS_BUNDLE_CUSTOM_VALUE
end
class RefreshApkJsBundleAction < Action
def self.run(params)
# fastlane will take care of reading in the parameter and fetching the environment variable:
require 'fastlane/actions/gradle'
import android.os.Bundle
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.WritableMap
object ReactNativeFirebaseMessagingSerializer {
fun klaviyoNotificationExtrasToWritableMap(
extras: Bundle?
): WritableMap? {
val notificationMap = Arguments.createMap()
@cristiangu
cristiangu / after.tsx
Last active September 28, 2023 11:00
Optimising React Native's View render speed
import React from 'react';
import { View } from './view';
const MyScreen = () => {
return Array.from(Array(5000).keys()).map((i) => (<View key={i} />));
}
@cristiangu
cristiangu / Example.tsx
Last active September 2, 2023 14:38
react-native-fast-image patch diff to fix the image change flickering
import FastImage from 'react-native-fast-image';
return (
<FastImage
useLastImageAsDefaultSource
source={source}
/>
);
@cristiangu
cristiangu / Step-1.tsx
Last active August 5, 2023 15:47
React Native Animated Bottom Modal in a Native Stack Navigator
<RootStack.Navigator>
<RootStack.Screen name="other-screen" component={OtherScreen} />
<RootStack.Group
screenOptions={{
presentation: 'containedTransparentModal',
animation: 'slide_from_bottom',
}}>
<RootStack.Screen name="g-modal" component={GModal} />
</RootStack.Group>
</RootStack.Navigator>
{
// put this inside /.vscode dir
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to packager",
"request": "attach",
@cristiangu
cristiangu / dabblet.css
Created December 20, 2014 13:52
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;