Skip to content

Instantly share code, notes, and snippets.

View amandeepmittal's full-sized avatar

Aman Mittal amandeepmittal

View GitHub Profile
View a.json
{
"cli": {
"version": ">= 2.9.0"
},
"build": {
"development": {
"distribution": "internal",
"android": {
"gradleCommand": ":app:assembleDebug"
},
View Podfile
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")
require 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
View test.js
let test='This be a test';
View CodeToAdd.js
useEffect(() => {
const collectionRef = collection(database, 'chats');
const q = query(collectionRef, orderBy('createdAt', 'desc'));
const unsubscribe = onSnapshot(q, querySnapshot => {
setMessages(
querySnapshot.docs.map(doc => ({
_id: doc.data()._id,
createdAt: doc.data().createdAt.toDate(),
text: doc.data().text,
@amandeepmittal
amandeepmittal / authors.js
Created October 1, 2021 11:00
mock data for authors
View authors.js
export const AUTHORS = [
{
title: 'David Banner',
description:
'American rapper, record producer and activist from Mississippi',
dateOfBirth: '1974-04-11T00:00:00Z',
image_url:
'http://commons.wikimedia.org/wiki/Special:FilePath/David%20Banner%20at%20FOB%20Brassfield-Mora%202009-01-26%203.jpg',
placeOfBirth: 'Jackson',
articleUrl: 'https://en.wikipedia.org/wiki/David_Banner',
@amandeepmittal
amandeepmittal / books.js
Created October 1, 2021 11:00
Mock data
View books.js
export const BOOKS = [
{
id: 1,
title: 'The Hunger Games',
authors: 'Suzanne Collins',
description:
"Winning will make you famous. Losing means certain death.The nation of Panem, formed from a post-apocalyptic North America, is a country that consists of a wealthy Capitol region surrounded by 12 poorer districts. Early in its history, a rebellion led by a 13th district against the Capitol resulted in its destruction and the creation of an annual televised event known as the Hunger Games. In punishment, and as a reminder of the power and grace of the Capitol, each district must yield one boy and one girl between the ages of 12 and 18 through a lottery system to participate in the games. The 'tributes' are chosen during the annual Reaping and are forced to fight to the death, leaving only one survivor to claim victory.When 16-year-old Katniss's young sister, Prim, is selected as District 12's female representative, Katniss volunteers to take her place. She and her male counterpart Peeta,
View .eslintrc.js
rules: {
'prettier/prettier': ['error'],
'no-use-before-define': 0,
'react/forbid-prop-types': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/jsx-fragments': 0,
'react/jsx-props-no-spreading': 0,
'react/style-prop-object': 0,
'react/require-default-props': 0,
'react/prop-types': 0,
View camera-video.js
import React, { useState, useRef, useEffect } from 'react';
import {
StyleSheet,
Dimensions,
View,
Text,
TouchableOpacity
} from 'react-native';
import { Camera } from 'expo-camera';
import { Video } from "expo-av";
View Details.js
import React, { useRef } from 'react';
import {
StyleSheet,
Text,
View,
TouchableOpacity,
ScrollView,
Image,
Dimensions
} from 'react-native';
View App.js
import 'react-native-gesture-handler';
import React from 'react';
import RootNavigator from './src/navigation/RootNavigator';
import { AuthenticatedUserProvider } from './src/navigation/AuthenticatedUserProvider';
const App = () => {
return (
<AuthenticatedUserProvider>
<RootNavigator />