Skip to content

Instantly share code, notes, and snippets.

View thechaudharysab's full-sized avatar

Chaudhry Talha thechaudharysab

View GitHub Profile
@thechaudharysab
thechaudharysab / AILinks_ReadME.md
Last active May 3, 2024 09:56
Links to AI Websites that you can use to make your work life more productive.
@thechaudharysab
thechaudharysab / React-RCTActionSheet.md
Last active September 3, 2022 08:16
CocoaPods could not find compatible versions for pod "React-RCTActionSheet"

CocoaPods could not find compatible versions for pod "React-RCTActionSheet"

I started getting this error:

  In Podfile:
    React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)

Specs satisfying the `React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)` dependency were found, but they required a higher minimum deployment target.
@thechaudharysab
thechaudharysab / Home.js
Created June 27, 2022 03:55
A simple redux-saga API call example for ReactJS
import { useDispatch, useSelector } from 'react-redux';
import { getUsersFetch } from './actions';
function Home() {
const dispatch = useDispatch();
const users = useSelector(state => { return state.myFirstReducer.users }); //this grabs the users list we have create in our reducer
return (
<div className="Home">
@thechaudharysab
thechaudharysab / App.js
Last active March 4, 2024 20:18
Redux Tutorial with Firebase firestore example. Tutorial Link: https://medium.com/@ibjects/tutorial-redux-and-react-redux-from-scratch-28249ee914e7
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import Home from './src/screens/Home';
import ReduxExample from './src/screens/ReduxExample';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import Home from './src/screens/Home';
import ReduxExample from './src/screens/ReduxExample';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
@thechaudharysab
thechaudharysab / Common Android Errors.md
Last active November 25, 2023 14:57
Common errors while building Android app for release/debug in React native

About the document

While building for android, sometimes there are errors. I've been working on react-native (these solutions will also work the same for flutter and other android dev languages) for quite sometime now and have faced errors throughtout but I have been documenting them locally so I'm creating this gist which I'll keep up-to-date as I face any new errors. Please note that all the solutions given here worked for me and they might not necessarily work for you so move with caution. Feel free to add your own solution that worked for you,


Task :react-native-gradle-plugin:compileKotlin FAILED

This occurs when your JDK version is not the same as mentioned in your project. To solve open the project in Android studio, make it finish its processing first then go to Preferences > Build, Execution, Deployment > Build Tools > Gradle and then Gradle Settings and select the correct JDK version i.e. it was JDK 8 in my case. Then try cleaning and building again.

Clean project, clean any build rel

@thechaudharysab
thechaudharysab / LoadingModal.js
Last active March 29, 2022 07:25
Loading component for React Native
import React from 'react';
import { View, ActivityIndicator, Text, StyleSheet } from 'react-native';
function LoadingModal({ message }) {
return (
<View style={styles.loading}>
<ActivityIndicator size='large' />
<Text style={{ color: 'white', padding: 10 }}>{message}</Text>
</View>
);
//Create john family object
var johnFamily = {
firstName: 'John',
lastName: 'Smith',
bills: [124, 48, 268, 180, 42], //all the bills values in an array
calcTip: function() {
this.tips = []; //new propety tips will be created
this.totalPaid = []; //new property totalPaid will be ceated
package com.ibjects.ComputerVision.MINST;
import org.apache.log4j.BasicConfigurator;
import org.datavec.image.loader.NativeImageLoader;
import org.deeplearning4j.datasets.iterator.impl.ListDataSetIterator;
import org.deeplearning4j.eval.Evaluation;
import org.deeplearning4j.nn.conf.MultiLayerConfiguration;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import org.deeplearning4j.nn.conf.layers.DenseLayer;
import org.deeplearning4j.nn.conf.layers.OutputLayer;
@thechaudharysab
thechaudharysab / IrisClassification.java
Last active May 23, 2021 05:54
Iris Classification Neural Network using Deep Learning for Java (DL4J) Library tutorial Link: https://medium.com/@ibjects/deep-learning-for-java-dl4j-getting-started-tutorial-2259c76c0a7c
package com.ibjects;
import org.apache.log4j.BasicConfigurator;
import org.datavec.api.records.reader.RecordReader;
import org.datavec.api.records.reader.impl.csv.CSVRecordReader;
import org.datavec.api.split.FileSplit;
import org.deeplearning4j.datasets.datavec.RecordReaderDataSetIterator;
import org.deeplearning4j.eval.Evaluation;
import org.deeplearning4j.nn.conf.MultiLayerConfiguration;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;