brew install nginx
Configuration file for nginx will be at /usr/local/etc/nginx/nginx.conf
Web apps can be stored at /usr/local/var/www
Start:
| import android.content.Context; | |
| import android.graphics.Canvas; | |
| import android.graphics.Paint; | |
| import android.graphics.RectF; | |
| import android.support.annotation.Nullable; | |
| import android.util.AttributeSet; | |
| import android.util.DisplayMetrics; | |
| import android.util.TypedValue; | |
| import android.view.View; |
| function ng --description "ng <port>" | |
| if test -z "$argv[1]" | |
| set port 3000 | |
| else | |
| set port $argv[1] | |
| end | |
| # Run ngrok in the background | |
| ngrok http $port > /dev/null & |
| import * as React from 'react'; | |
| import { LayoutAnimation, Pressable, PressableProps } from 'react-native'; | |
| type ChildrenOrRenderProp = React.ReactNode | ((mode: Context['mode']) => React.ReactNode); | |
| type RewriteChildren<PropsType = Record<string, unknown>> = React.FC< | |
| Omit<PropsType, 'children'> & { children?: ChildrenOrRenderProp } | |
| >; | |
| interface Context { |
| import * as React from 'react' | |
| import { Image, StatusBar, StyleSheet, useWindowDimensions } from 'react-native' | |
| import { | |
| PanGestureHandler, | |
| PinchGestureHandler, | |
| PinchGestureHandlerGestureEvent, | |
| TapGestureHandler, | |
| TapGestureHandlerGestureEvent, | |
| } from 'react-native-gesture-handler' | |
| import Animated, { |
| public Matrix calculateTextureMatrix(TextureView textureView, View previewView) { | |
| Matrix matrix = new Matrix(); | |
| Camera.Size previewSize = mICamera.mCamera.getParameters().getPreviewSize(); | |
| float actualPreviewWidth = previewSize.width; | |
| float actualPreviewHeight = previewSize.height; | |
| float previewWidth = previewView.getWidth(); | |
| float previewHeight = previewView.getHeight(); | |
| int deviceAndCameraAngleDiff = mICamera.getCameraAngle(this); |
| private Camera.Size calBestPreviewSize(Camera.Parameters camPara, | |
| final int width, final int height) { | |
| List<Camera.Size> allSupportedSize = camPara.getSupportedPreviewSizes(); | |
| ArrayList<Camera.Size> widthLargerSize = new ArrayList<Camera.Size>(); | |
| for (Camera.Size tmpSize : allSupportedSize) { | |
| if (tmpSize.width > tmpSize.height) { | |
| widthLargerSize.add(tmpSize); | |
| } | |
| } |
| #!/bin/bash | |
| user=$(id -un) | |
| rm -rf ProjectName.xcframework && \ | |
| xcodebuild archive \ | |
| -workspace ProjectName.xcworkspace \ | |
| -scheme ProjectName \ | |
| -destination "generic/platform=iOS" \ | |
| -archivePath "archives/ios" \ | |
| SKIP_INSTALL=NO \ | |
| SWIFT_SERIALIZE_DEBUGGING_OPTIONS=NO \ |
| # Connect device over USB | |
| # Get device IP | |
| adb shell ip -f inet addr show wlan0 | |
| # Define port | |
| adb tcpip 5555 | |
| # Connect | |
| adb connect {device ip}:5555 | |
| # Disconnect USB |