Skip to content

Instantly share code, notes, and snippets.

View cdanwards's full-sized avatar
:shipit:

Daniel Edwards cdanwards

:shipit:
View GitHub Profile
@cdanwards
cdanwards / .patch
Created May 13, 2025 15:25
patches/react-native-web+0.20.0.patch
diff --git a/node_modules/react-native-web/dist/exports/findNodeHandle/index.js b/node_modules/react-native-web/dist/exports/findNodeHandle/index.js
index c2aa986..a511bac 100644
--- a/node_modules/react-native-web/dist/exports/findNodeHandle/index.js
+++ b/node_modules/react-native-web/dist/exports/findNodeHandle/index.js
@@ -9,6 +9,6 @@
*/
var findNodeHandle = component => {
- throw new Error('findNodeHandle is not supported on web. ' + 'Use the ref property on the component instead.');
+ return component && component._componentViewTag;
@cdanwards
cdanwards / OGVFileShare.txt
Created August 29, 2023 20:39
New Expensify XCode Logs - File sharing failing
2023-08-29 16:33:59.966047-0400 New Expensify[80724:1524008] [Airship] [I] AirshipKit/DefaultAppIntegrationDelegate.swift didRegisterForRemoteNotifications(deviceToken:) [Line 31] Application registered device token: 80 bytes
2023-08-29 16:34:02.751238-0400 New Expensify[80724:1524008] [Airship] [I] AirshipKit/Push.swift didRegisterForRemoteNotifications(_:) [Line 939] Device token string: 804fd92d66a2eefca64a8c7c84a13458f2b7f6c5340e788ffde885c5779c287b4256311b23dd2f49eab80d171f50a6527fb3a9706ff75865351e839bc5b5c98a75ccd4bbecbf04afe0d767f245cf2a17
2023-08-29 16:34:04.812259-0400 New Expensify[80724:1524008] [Airship] [I] AirshipKit/Push.swift deviceToken [Line 315] Device token: 804fd92d66a2eefca64a8c7c84a13458f2b7f6c5340e788ffde885c5779c287b4256311b23dd2f49eab80d171f50a6527fb3a9706ff75865351e839bc5b5c98a75ccd4bbecbf04afe0d767f245cf2a17
2023-08-29 16:34:04.963639-0400 New Expensify[80724:1524008] [Airship] [D] AirshipKit/Analytics.swift addEvent(_:) [Line 434] Adding device_registration event 307C33CD-31FF-4A
@cdanwards
cdanwards / Maestro Logs
Created August 17, 2023 17:28
Maestro Hierarchy not detecting elements in a Share Extension (react-native-share-menu)
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild test-without-building -xctestrun /var/folders/gv/3h_xyf194dbcrpw414nkyn4h0000gn/T/335CA049-9561-4A26-8E6E-9FFE26E6F3D9/maestro-driver-ios-config.xctestrun -destination id=335CA049-9561-4A26-8E6E-9FFE26E6F3D9 -derivedDataPath /var/folders/gv/3h_xyf194dbcrpw414nkyn4h0000gn/T/maestro_xctestrunner_xcodebuild_output13214139191714501088
User defaults from command line:
IDEDerivedDataPathOverride = /var/folders/gv/3h_xyf194dbcrpw414nkyn4h0000gn/T/maestro_xctestrunner_xcodebuild_output13214139191714501088
IDEPackageSupportUseBuiltinSCM = YES
2023-08-16 10:16:55.029887-0400 maestro-driver-iosUITests-Runner[67229:23938143] Running tests...
Test Suite 'All tests' started at 2023-08-16 10:16:55.397
Test Suite 'maestro-driver-iosUITests.xctest' started at 2023-08-16 10:16:55.398
...
import shuffle from "lodash.shuffle"
...
...
export const QuestionModel = types
...
.views((self) => ({
get allAnswers() {
return shuffle(self.incorrectAnswers.concat([self.correctAnswer]))
@cdanwards
cdanwards / RootStore.ts
Created March 14, 2023 14:40
Rootstore.ts for Ignite Trivia App.
import { Instance, SnapshotOut, types } from "mobx-state-tree"
import { QuestionStoreModel } from "./QuestionStore"
/**
* A RootStore model.
*/
export const RootStoreModel = types.model("RootStore").props({
questionStore: types.optional(QuestionStoreModel, {} as any),
})
@cdanwards
cdanwards / QuestionScreen.tsx
Created January 30, 2023 19:06
QuestionScreen after adding the CheckAnswer button.
export const QuestionScreen: FC<StackScreenProps<AppStackScreenProps, "Question">> = observer(
function QuestionScreen() {
...
const onPressAnswer = (question: Question, guess: string) => {
question.setGuess(guess)
}
const checkAnswer = (question: Question) => {
@cdanwards
cdanwards / Question.ts
Last active March 14, 2023 14:47
Final version of the Question.ts file for the ignite trivia app
...
import shuffle from "lodash.shuffle"
...
export const QuestionModel = types
.model("Question")
.props({
id: types.identifier,
category: types.maybe(types.string),
type: types.enumeration(["multiple", "boolean"]),
import React, { FC, useEffect } from "react"
import { observer } from "mobx-react-lite"
import { FlatList, TextStyle, View, ViewStyle } from "react-native"
import { StackScreenProps } from "@react-navigation/stack"
import { AppStackScreenProps } from "../navigators"
import { Screen, Text } from "../components"
import { spacing, colors } from "../theme"
import { Question, useStores } from "../models"
import { decodeHTMLEntities } from "../utils/decode-html"
@cdanwards
cdanwards / QuestionScreen.tsx
Created January 30, 2023 16:08
Header portion of the QuestionScreen file
import { useStores } from "../models"
...
export const QuestionScreen: FC<StackScreenProps<AppStackScreenProps, "Question">> = observer(
function QuestionScreen() {
// Pull in one of our MST stores
const { questionStore } = useStores()
@cdanwards
cdanwards / QuestionScreen.tsx
Last active March 14, 2023 14:35
First iteration of the QuestionScreen for the ignite trivia app
import React, { FC } from "react"
import { observer } from "mobx-react-lite"
import { TextStyle, View, ViewStyle } from "react-native"
import { StackScreenProps } from "@react-navigation/stack"
import { AppStackScreenProps } from "../navigators"
import { Screen, Text } from "../components"
import { colors, spacing } from "../theme"
// import { useNavigation } from "@react-navigation/native"
// import { useStores } from "../models"