Skip to content

Instantly share code, notes, and snippets.

View Abdelwahab313's full-sized avatar
🎯
Hopeful

Abdelwahab Abdelwahab313

🎯
Hopeful
View GitHub Profile
@Abdelwahab313
Abdelwahab313 / install.sh
Created January 8, 2022 16:08 — forked from aaabramov/install.sh
Installing zsh + oh-my-zsh on Amazon EC2 Amazon Linux 2 AMI. (Prepared in the scope of posting https://aaabramov.medium.com/installing-zsh-oh-my-zsh-on-amazon-ec2-amazon-linux-2-ami-88b5fc83109)
sudo yum update
# Installing ZSH
sudo yum -y install zsh
# Check ZSH has been installed
zsh --version
# Install "util-linux-user" because "chsh" is not available by default
# See https://superuser.com/a/1389273/599050
@Abdelwahab313
Abdelwahab313 / reseed.rake
Created June 26, 2020 16:55 — forked from nithinbekal/reseed.rake
Rake task to reset and seed Rails database
# Originally written by Justin French (2008):
# http://justinfrench.com/notebook/a-custom-rake-task-to-reset-and-seed-your-database
#
# Modified to work with Rails 4.
desc 'Raise an error unless development environment'
task :safety_check do
raise "You can only use this in dev!" unless Rails.env.development?
end

react native double-conversion-1.1.5/src/diy-fp.cc conversion failed

I was facing a similar issue after upgrading. To solve it I ran the following commands:

$ cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../ $ cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../ Now Xcode builds fine.

facebook/react-native#21168 (comment)

it('check input component is wrapped in BaseFieldLayout', () => {
expect(BaseFieldHOCComponent.props.className).toEqual('form-group');
});
@Abdelwahab313
Abdelwahab313 / FBSDKShareKit file not found.md
Last active November 9, 2018 09:53
Xcode always says ‘FBSDKShareKit/FBSDKShareKit’.h file not found

I had this problem with XCode 10!!! Sorted in this way:

  • Select Libraries > RCTFBSDK.xcodeproj
  • Select Build Settings > Framework Search Paths
  • Replace the ~/Documents/FacebookSDK to $(HOME)/Documents/FacebookSDK (with parentheses!)

Believe it or not, now it works!

Xcode 10 libfishhook.a cannot be found #19569
For a solution, I copied the file from my ios/build/Build/Products/Debug-iphonesimulator/libfishhook.a and pasted it into ../node_modules/react-native/Libraries/WebSocket/ and got the build. I hope it helps.
Loading dependency graph...(node:9266) UnhandledPromiseRejectionWarning: Error: `fsevents` unavailable (this watcher can only be used on Darwin)
at new FSEventsWatcher (/Users/samadisy/dev/Fikr2.0/shapa-react-native/node_modules/sane/src/fsevents_watcher.js:41:11)
at createWatcher (/Users/samadisy/dev/Fikr2.0/shapa-react-native/node_modules/jest-haste-map/build/index.js:600:23)
at Array.map (<anonymous>)
at HasteMap._watch (/Users/samadisy/dev/Fikr2.0/shapa-react-native/node_modules/jest-haste-map/build/index.js:747:25)
at _buildPromise._buildFileMap.then.then.hasteMap (/Users/samadisy/dev/Fikr2.0/shapa-react-native/node_modules/jest-haste-map/build/index.js:279:21)
(node:9266) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9266) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprec
@Abdelwahab313
Abdelwahab313 / ubuntu_agnoster_install.md
Created May 17, 2018 07:50 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

Setting up react native test environment.

install React Native on global

npm install react-native-cli -g

create the project

react-native init <ProjectName>

npm install --save enzyme react-dom enzyme-adapter-react-16

This error comes when trying to import react-native-camera component or using it inside the jest tests.

you can solve this by mocking the react-native-camera.

Best solution is by adding these lines inside setuptests.js
jest.mock('react-native-camera', () => {
    return {
        addEventListener: jest.fn(),
 removeEventListener: jest.fn(),