Skip to main content

Posts

Showing posts from March, 2024

Notification alert for a React Native and Expo project

steps to create a notification alert for a React Native and Expo project: 1. Install the necessary libraries : You need to install the `expo-notifications` library. You can do this by running the following command in your terminal: npx expo install expo-notifications If you're installing this in a bare React Native app, you should also follow the additional installation instructions². 2. Set up the notification handler: You can set up the notification handler as follows: javascript Notifications.setNotificationHandler({   handleNotification: async () => ({     shouldShowAlert: true,     shouldPlaySound: false,     shouldSetBadge: false,   }), }); 3. Register for push notifications: You can register for push notifications in your component’s `useEffect` hook. Here is an example of how you can do this: javascript useEffect(() => {   registerForPushNotificationsAsync().then(token => setExpoPushToken(token));   notificationListener...

Developer useful extensions, shortcut keywords, and tricks for VS Code

Here are some top developer useful extensions, shortcut keywords, and tricks for Visual Studio Code (VS Code):  Extensions: 1. ESLint: For JavaScript and TypeScript linting. 2. Prettier: Code formatter for consistent code style. 3. GitLens: Enhances Git integration with features like blame annotations and code lens. 4. Debugger for Chrome: Debug JavaScript code in Chrome directly from VS Code. 5. Live Server: Launches a live server for web development with auto-reload.  Shortcut Keywords: 1. Ctrl + Shift + P: Open the Command Palette for quick access to commands. 2. Ctrl + B: Toggle the sidebar. 3. Ctrl + `: Open the integrated terminal. 4. Ctrl + Shift + E: Open the Explorer view. 5. Ctrl + Shift + F: Search across files in the workspace. 6. Ctrl + Shift + L: Select all occurrences of the current word.  Tricks: 1. Multi-Cursor Editing: Use Alt + Click to add multiple cursors for simultaneous editing. 2. Code Snippets: Utilize built-in or custom code snippets for faster c...