Skip to content

Instantly share code, notes, and snippets.

View RidaRidss's full-sized avatar
🎯
Focusing

Rida Sarwar RidaRidss

🎯
Focusing
View GitHub Profile
@RidaRidss
RidaRidss / Problems reading data from Binary store
Last active August 5, 2021 17:48
Problems reading data from Binary store in /private/var/folders/6x/zv62_x554hl3bf9yzxclhwg00000gn/T/gradle9135510241749950678.bin offset 276943 exists?
When Gradle Files doesnot sync, Choose command as per your system OS , run & have fun :)
For Windows :
cd android && ./gradlew clean dependencies --no-parallel --no-build-cache
For Mac :
sudo ./gradlew clean dependencies --no-parallel --no-build-cache
@RidaRidss
RidaRidss / Clean Cache React Native Project In Mac
Last active June 7, 2024 07:33
Clean Cache In React Native Project On Mac (pods,yarn,npm) ~ cache clean
rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/haste-*; rm -rf $TMPDIR/metro-*; watchman watch-del-all; rm -r node_modules/ ; rm -r android/app/build; npm cache verify ; yarn cache clean ; cd ios ; rm -Rf Pods/* && pod cache clean --all && rm -rf ~/Library/Caches/CocoaPods; rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*; pod deintegrate; cd .. && npm install && cd ios; pod install

android/app/build.gradle

--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -80,6 +80,8 @@ import com.android.build.OutputFile
 
 project.ext.react = [
     enableHermes: true,  // clean and rebuild if changing
+    entryFile: "index.js",
+    bundleAssetName: "app.bundle",
@RidaRidss
RidaRidss / UUID_generator.js
Created June 22, 2021 08:12
Universally Unique Identifier (UUID) Generator
/*
***
***
**
*
A unique identifier (UID) is an identifier that marks that particular record as unique from every other record.
It allows the record to be referenced in the Summon Index without confusion or unintentional overwriting from other records.
***
***
**
@RidaRidss
RidaRidss / createCrudHooks.js
Created June 22, 2021 07:53 — forked from tannerlinsley/createCrudHooks.js
A naive, but efficient starter to generate crud hooks for React Query
export default function createCrudHooks({
baseKey,
indexFn,
singleFn,
createFn,
updateFn,
deleteFn,
}) {
const useIndex = (config) => useQuery([baseKey], indexFn, config)
const useSingle = (id, config) =>
@RidaRidss
RidaRidss / Install nvm in mac os globally
Created May 19, 2021 08:42
Install nvm in mac os globally
* npm install nvm -g
* Appending nvm source string to /Users/Rida/.bash_profile
* Appending bash_completion source string to /Users/Rida/.bash_profile
* Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
@RidaRidss
RidaRidss / Images are not showing iOS 14 or compilation with Xcode 12
Last active May 19, 2021 08:44
Images are not showing in iOS 14 or compilation with Xcode 12
react-native/Libraries/Image/RCTUIImageViewAnimated.m. *** Lines 283 to 289 ***
- (void)displayLayer:(CALayer *)layer
{
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
}
}
@RidaRidss
RidaRidss / IOS 14 date picker modals are not showing correctly
Created May 19, 2021 08:27
IOS 14 date picker modals are not showing correctly
if (@available(iOS 14, *)) {
UIDatePicker *picker = [UIDatePicker appearance];
picker.preferredDatePickerStyle = UIDatePickerStyleWheels;
}
Put the above code in AppDelegate.m file, this will override the preferedStyle of any UIDatePicker in the iOS native Workspace
@RidaRidss
RidaRidss / Fix Multiple npm version conflict issue
Last active May 19, 2021 08:42
Fix Multiple npm version conflict issue globally in system
--- If you have multiple npm versions globally in system it causes problem in compilation of projects , make sure you have a stable version in your system ---
*** Multiple npm version conflict issue can occur if you took an update when npm update warning comes in terminal while working ***
note : Use nvm globally to manage node versions in system, if you don't have nvm then install nvm first by following step from this gist https://gist.github.com/RidaRidss/165c2ea31c8de1089e22495f315c7247
"Open terminal & run commands"
1. sudo chown -R $(whoami) ~/.npm