Skip to content

Instantly share code, notes, and snippets.

View mathias5r's full-sized avatar

Mathias Silva da Rosa mathias5r

View GitHub Profile
@mathias5r
mathias5r / config.yml
Last active January 7, 2026 17:45
Fingerprint + CircleCi
build_nonprod_ios_local:
executor: macos_executor
steps:
- checkout_and_attach
- run:
name: 'Run expo fingerprint'
command: |
npx @expo/fingerprint@latest . > fingerprint.json
- restore_cache:
keys:
@mathias5r
mathias5r / config.yml
Created October 30, 2024 02:03
Persisting the package
- persist_to_workspace:
root: .
paths:
- ios/build/Build/Products/Release-iphonesimulator/MyApp.app
@mathias5r
mathias5r / config.yml
Created October 30, 2024 02:00
Replacing js bundle
- run:
name: 'Replace js bundle'
command: |
npx expo export:embed --platform ios --dev false --entry-file node_modules/expo-router/entry.js --bundle-output ios/build/Build/Products/Release-iphonesimulator/MyApp.app/main.jsbundle --assets-dest ios/build/Build/Products/Release-iphonesimulator/MyApp.app
@mathias5r
mathias5r / config.yml
Last active October 30, 2024 01:42
Saving cache
- save_cache:
key: 1-ios-build-{{ checksum "fingerprint.json" }}
paths:
- ios/build/Build/Products/Release-iphonesimulator/MyApp.app
@mathias5r
mathias5r / config.yml
Created October 30, 2024 01:29
Build app
- run:
name: 'Build nonprod app locally'
command: |
if [ ! -d "ios/build/Build/Products/Release-iphonesimulator/MyApp.app" ]; then
xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Release -sdk iphonesimulator -derivedDataPath ios/build
else
echo "Cached ios build already exists"
fi
@mathias5r
mathias5r / config.yml
Created October 11, 2024 21:50
Restore cache
- restore_cache:
keys:
- 1-ios-build-{{ checksum "fingerprint.json" }}
@mathias5r
mathias5r / config.yml
Last active October 11, 2024 21:44
Generate fingerprint
- run:
name: 'Run expo fingerprint'
command: npx @expo/fingerprint@latest . > fingerprint.json
@mathias5r
mathias5r / generic-component-usage.tsx
Last active November 23, 2021 23:37
generic-component-usage.tsx
const items = [
{
text: 'item1',
data: {
onPress: () => new Promise.resolve()
},
},
];
const UsingMyList: React.FC = () => (
@mathias5r
mathias5r / generic-component.tsx
Created November 4, 2021 01:28
generic component
const MyList = <T extends unknown>({items, onItemSelected}: MyListProps<t>): JSX.Element => (
<FlatList
data={items}
renderItem={({item}: {item: MyListItemProps<T>}) => (
<TouchableOpacity onPress={() => onItemSelected(item)}>
<Text>{item.text}</Text>
</TouchableOpacity>
)}
/>
);
@mathias5r
mathias5r / generic-props.tsx
Created November 4, 2021 01:06
using generic
type MyListItemProps<T> = {
text: string;
data: T;
};
type MyListProps<T> = {
items: MyListItemProps<T>[];
onItemSelected: (item: MyListItemProps<T>) => void;
};