Posts

How to scroll to bottom in ionic 3 and angular 5

HTML Template : html Copy the below code           <ion-content #content>                  <!-- Your content here -->            </ion-content>                 <button ion-button (click)="scrollToBottom()">Scroll to Bottom</button> Component TypeScript File : typescript Copy the below code import { Component, ViewChild } from '@angular/core'; import { Content } from 'ionic-angular'; @Component({   selector: 'page-home',   templateUrl: 'home.html' }) export class HomePage {   @ViewChild(Content) content: Content;   constructor() {}   scrollToBottom() {     this.content.scrollToBottom();   } } In the above example: We have an <ion-content> element with a template reference variable #content. We use @ViewChild(Content) to get a reference to the Content component. The scrollToBottom() method is called when the "Scroll to Bottom" button is clicked, which scrolls the content to the bottom. If you facin

How to connect Android Device through Wife using adb command

Image
Connecting an Android device via Wi-Fi ADB (Android Debug Bridge) allows you to debug and execute commands on your device wirelessly, without the need for a USB connection. Here's how you can set up and connect an  Android device through Wi-Fi ADB: Prerequisites: Android device with Developer Options enabled USB cable (for initial setup) A computer with ADB installed Steps: 1. Enable Developer Options and USB Debugging: On your Android device, go to Settings. Scroll down and tap on About phone. Find the Build number and tap on it 7 times. This will enable Developer Options. Go back to the main Settings page and select Developer options. Turn on USB Debugging. 2. Connect Android Device via USB: Connect your Android device to your computer using a USB cable. Open a terminal or command prompt on your computer. Check if your device is recognized by ADB with the following command: adb devices You should see your device listed. If prompted on your Android device to allow USB debugging, a

How to remove commented line in visual studio code using regex

In Visual Studio Code (VSCode), you can remove commented code using the "Find and Replace" feature with a regular expression. Here's a step-by-step guide on how to do it: Open your file in VSCode : Launch VSCode and open the file from which you want to remove commented code. Open the Find and Replace Panel : Use the shortcut Ctrl + F (Windows/Linux) or Cmd + F (Mac) to open the "Find" panel. Alternatively, you can use the shortcut Ctrl + H (Windows/Linux) or Cmd + Option + F (Mac) to open the "Find and Replace" panel directly. Enable Regular Expression Search : Click on the .* icon in the "Find" panel or the .* toggle in the "Find and Replace" panel to enable regular expression search. Enter the Regular Expression : In the "Find" input box, enter the regular expression to match commented code. For example, to match single-line comments starting with //, you can use:bash Copy code ^\s*\/\/.*$ If you want to match multi-line

How to clean up the unused imports, variable and function from Typescript

To remove unused code from TypeScript files in your project, you can use the "Purge & Unused CSS" extension or tools like "TSLint" with its related plugins. These tools can help you identify and remove unused code, including variables, functions, and imports, from your TypeScript files. Here's a step-by-step guide to help you remove unused code using TSLint and related plugins: Using TSLint and TSLint Unused Imports Plugin: Install TSLint : If you haven't installed TSLint in your project, you can install it using npm or yarn: npm install tslint --save-dev # or yarn add tslint --dev Install TSLint Unused Imports Plugin : Install the tslint-plugin-unused-imports plugin to help identify and remove unused imports: npm install tslint-plugin-unused-imports --save-dev # or yarn add tslint-plugin-unused-imports --dev Create TSLint Configuration File : Create a tslint.json configuration file in your project root or update an existing one. Add the following config

Decompile or (Reverse Engine) an APK on macOS

Image
Required: jd-gui - https://java-decompiler.github.io/ apktool - https://apktool.org/ dex2jar - https://github.com/pxb1988/dex2jar Download and Install APKTool: Once you have the JDK installed, you can download and install APKTool using Homebrew: brew install apktool Verify Installation: After installing APKTool, you can verify the installation by running the following command in Terminal: bash apktool --version Usage: To decompile an APK file using APKTool, navigate to the directory containing the APK file in Terminal and run the following command: bash apktool d filename.apk If this error occur: getting error "Error: python@3.12: the bottle needs the Apple Command Line Tools to be installed." Here's how you can install the Apple Command Line Tools and resolve the error: 1. Install Apple Command Line Tools: You can install the Apple Command Line Tools using the following command in the Terminal: bash xcode-select --install This command will prompt you to install the C