Skip to content

Instantly share code, notes, and snippets.

View bewithdhanu's full-sized avatar
😜
Focusing

Dhanu K bewithdhanu

😜
Focusing
View GitHub Profile
@bewithdhanu
bewithdhanu / android locations.md
Created September 4, 2023 12:19
Android - Approximate Location and Precise Location

Certainly! You can implement a settings screen where the user can choose between "Approximate Location" and "Precise Location". Based on their choice, you can then request the appropriate permission. Here's how you can achieve this:

1. Create a Settings Screen:

You can use SharedPreferences to store the user's choice. Provide two radio buttons or a switch/toggle for the user to select between "Approximate Location" and "Precise Location".

2. Check User's Choice:

Before requesting location, check the user's choice from SharedPreferences:

@bewithdhanu
bewithdhanu / task.md
Last active September 1, 2023 08:52
Interview Task

Task Description:

You are required to create a registration form using HTML, JavaScript/jQuery, and the provided JSON data. The JSON data includes all the necessary details for the form, such as fields, buttons, and their respective attributes.

JSON Data:

{
  "form": {
@bewithdhanu
bewithdhanu / phadmin4_setup_ubuntu_20.04.md
Last active July 1, 2024 13:27
Setting up pgAdmin4 with Docker

Setting up pgAdmin4 with Docker

To set up pgAdmin4 with Docker, follow these steps:

Installation and Docker Setup

  1. Install the required dependencies:

    sudo apt install apt-transport-https ca-certificates curl software-properties-common
@bewithdhanu
bewithdhanu / nodejs-socket-server-setup-ubuntu.md
Last active June 12, 2023 08:44
Setting up a Node.js Socket Server on Ubuntu

Setting up a Node.js Socket Server

This guide will show you how to set up a Node.js Socket Server on a Linux machine. The server will use the Socket.io library to handle real-time communication between clients.

Prerequisites

Before we begin, ensure that you have the following:

  • A Linux machine with root access
@bewithdhanu
bewithdhanu / WebView-JavaScript-Communication-Android-iOS.md
Last active January 6, 2025 08:20
WebView JavaScript Communication Guide
@bewithdhanu
bewithdhanu / apache-http2-ubuntu-20.04.md
Last active October 28, 2024 07:18
Enabling HTTP/2 protocol in Apache HTTP server on Ubuntu 20.04

Enabling HTTP/2 protocol in Apache HTTP server on Ubuntu 20.04

It looks like you're trying to enable HTTP/2 on your Apache server and switch from mod_php to php-fpm. Here's a refined and improved version of your commands, incorporating best practices and explanations:

1. Check Apache Version:

apache2 -v
@bewithdhanu
bewithdhanu / readme.md
Last active April 17, 2023 10:50
How to Start and Run a Node.js Service in the Background using PM2

How to Start and Run a Node.js Service in the Background using PM2

If you're running a Node.js service and want to keep it running in the background even after you log out, PM2 is a great tool to use. In this tutorial, we'll walk through the steps of starting and running a Node.js service in the background using PM2.

Step 1: Navigate to the Service Directory

First, navigate to the directory where your Node.js service is located. For example, if your service is located in /var/www/html/dandie/nodejs, you would navigate to that directory using the following command:

cd /var/www/html/dandie/nodejs

@bewithdhanu
bewithdhanu / Setup_multiple_PHP_Versions_on_macOS.md
Last active April 24, 2023 09:57
Setup multiple PHP Versions on macOS

Setup multiple PHP Versions on macOS

XCode Command Line Tools

If you have not yet installed XCode, please install the XCode Command Line Tools. These are required for brew. Open your Terminal and run:

xcode-select --install

Brew

@bewithdhanu
bewithdhanu / Social_Media_Meta_Tags.md
Created April 13, 2023 11:54
Optimising Your Web Content for Social Media: A Guide to Using Meta Tags

Here are the meta tags you can use for various social media platforms:

Facebook

<meta property="og:url" content="https://example.com">
<meta property="og:type" content="website">
<meta property="og:title" content="My Page">
<meta property="og:description" content="This is a description of my page.">
@bewithdhanu
bewithdhanu / Cache_Eloquent_Queries_in_Laravel.md
Last active April 13, 2023 11:54
Cache Eloquent Queries and Models in Laravel

Laravel Eloquent Query Cache

Laravel Eloquent Query Cache is a package that provides caching for Eloquent queries.

Installation

To install this package, run the following command: