- Come funzionano (esempio)
const fs = require('fs');
# 1. Make sure to globally install the npm ios-deploy module first: | |
npm i -g ios-deploy | |
# 2. Run the following command: | |
react-native run-ios --device | |
# Hint - You can also specify the device name if needed: | |
react-native run-ios --device "Paul's iPhone" |
package com.example.matteo.firebase_recycleview; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import android.view.ViewGroup; | |
import com.firebase.client.ChildEventListener; | |
import com.firebase.client.DataSnapshot; | |
import com.firebase.client.FirebaseError; |
export function* signup (action) { | |
const { email, password } = action | |
try { | |
const user = yield call(parseService.signup, email, password) | |
yield put({ type: authActionTypes.SIGNUP_SUCCESS, user }) | |
yield call(loginSuccess, user) | |
} catch (err) { | |
const error = err.message || err | |
yield put({ type: authActionTypes.SIGNUP_FAILURE, error }) | |
} |
#!/bin/bash | |
# Starts the metro bundler and runs react-native in a single terminal (à la Expo). | |
# CTRL + C kills the metro bundler. | |
# Arguments: | |
# -p Development platform [ios (default), android]. | |
# -s Starts scrcpy too. Android only. (https://github.com/Genymobile/scrcpy) | |
COLOR_RED='\033[0;31m' | |
COLOR_CYAN='\033[0;36m' | |
COLOR_PURPLE='\033[0;35m' |
import * as React from "react"; | |
import { StyleSheet, Text, View } from "react-native"; | |
class LoginScreen extends React.Component<{}> { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>Welcome to the login screen!</Text> | |
</View> | |
); |
export default class CroppedImage extends Component { | |
state = { | |
croppedImageSources: [] | |
}; | |
async componentDidMount() { | |
const crops = 4; | |
const croppedImageHeight = imHeight / crops; | |
const croppedImageSources = []; | |
for (let i = 0; i <= crops; i++) { |
package com.example.matteomazzarolo.imagetest; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.ImageView; | |
import android.widget.TextView; |
if pgrep scrcpy; then | |
osascript -e 'tell application "System Events" to tell process "scrcpy"' \ | |
-e 'set frontmost to true' \ | |
-e 'if windows is not {} then perform action "AXRaise" of item 1 of windows' \ | |
-e 'end tell' | |
else | |
/usr/local/bin/scrcpy | |
fi |