Skip to content

Instantly share code, notes, and snippets.

View FreddyPoly's full-sized avatar
🍎

Frédéric Llorca FreddyPoly

🍎
  • 19:59 (UTC +02:00)
View GitHub Profile
@FreddyPoly
FreddyPoly / terminal
Created February 2, 2020 15:08
Setup .nvmrc file
node -v > .nvmrc
@FreddyPoly
FreddyPoly / terminal
Created November 27, 2019 17:20
[REACT NATIVE] Génération .apk, .aab
La commande `react-native run-android --variant=release` génère directement un APK dans le dossier `android/app/build/outputs/apk/release/app-release.apk`
Google donne la possibilité maintenant de générer des .aab qui sont beaucoup plus légers et qui sont donc préférables
Pour en générer:
`cd android/`
`./gradlew bundleRelease`
Cette commande va générer un AAB dans le dossier `android/app/build/outputs/bundle/release/app.aab`
@FreddyPoly
FreddyPoly / component.tsx
Created November 21, 2019 13:53
[REACT NATIVE] Exemple component avec accès navigation
import * as React from "react"
import { View, Text } from "react-native"
import { NavigationScreenProps } from "react-navigation" // <===
export interface Props extends NavigationScreenProps<{}> { // <===
propsVar: any;
}
export interface State {
stateVar: any;
@FreddyPoly
FreddyPoly / navigation-store.ts
Created October 18, 2019 09:23
[REACT NATIVE] État navigation non persistent
...
.preProcessSnapshot(snapshot => {
if (!snapshot || !Boolean(snapshot.state)) return snapshot
return { ...snapshot, state: DEFAULT_STATE }
})
...
@FreddyPoly
FreddyPoly / terminal
Created October 14, 2019 09:32
[REACT NATIVE] Watchman crawl failed. Retrying once with node crawler.
watchman shutdown-server
brew update
brew reinstall watchman
@FreddyPoly
FreddyPoly / unity interface
Created August 5, 2019 15:38
[UNITY] Test Projet
Pour tester le projet sur un device:
1 - CMD + MAJ + B
2 - Player settings
3 - Dans "Publishing settings", mettre le mdp pour
'keystore password'
'Password' (pour le alias de la Key)
Mot de passe classique en i
4 - Dans la popup de CMD + MAJ + B, cocher:
'Build App Bundle (Google Play)'
@FreddyPoly
FreddyPoly / console
Created July 29, 2019 10:46
[ANDROID] Take screenshots and videos
# Take a screenshot from an Android device connected:
1 - Takes the screenshot
2 - Pull the screenshot from the device to the computer
3 - Deletes the screenshot on the device
For a file named `screen.png`
`adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png && adb shell rm /sdcard/screen.png`
@FreddyPoly
FreddyPoly / .babelrc
Created July 5, 2019 13:48
[REACT NATIVE] Env Var babel
{
"presets": ["module:metro-react-native-babel-preset"],
"env": {
"production": {
}
},
"plugins": [
[
"transform-inline-environment-variables",
{
@FreddyPoly
FreddyPoly / app.tsx
Created July 5, 2019 13:22
[REACT NATIVE] Splash App
import "./i18n"
import * as React from "react"
import { AppRegistry } from "react-native"
import { StatefulNavigator } from "./navigation"
import { StorybookUIRoot } from "../storybook"
import { RootStore, setupRootStore } from "./models/root-store"
import { Provider } from "mobx-react"
import { BackButtonHandler } from "./navigation/back-button-handler"
import { contains } from "ramda"
import { DEFAULT_NAVIGATION_CONFIG } from "./navigation/navigation-config"
@FreddyPoly
FreddyPoly / MainActivity.java
Created July 5, 2019 13:04
[REACT NATIVE] Splash Main Activity
package com.boilerplatetest;
import com.facebook.react.ReactActivity;
import android.os.Bundle;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import org.devio.rn.splashscreen.SplashScreen;