javascript get current location latitude and longitude

The getCurrentPosition() method is used to return the user’s position. <script> var x = document.getElementById(“demo”); function getLocation() {   if (navigator.geolocation) {     navigator.geolocation.getCurrentPosition(showPosition);   } else {     x.innerHTML = “Geolocation is not supported by this browser.”;   } } function showPosition(position) {   x.innerHTML = “Latitude: ” + position.coords.latitude +    “<br>Longitude: ” + position.coords.longitude;  } </script> Example explained: Check if Geolocation is supported If supported, run the getCurrentPosition() method. If not, […]

Read More

www to https redirect laravel | laravel htaccess redirect to https

What about just using .htaccess file to achieve https redirect? This should be placed in project root (not in public folder). Your server needs to be configured to point at project root directory. <IfModule mod_rewrite.c> RewriteEngine On # Force SSL RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Remove public folder form URL RewriteRule ^(.*)$ public/$1 [L] […]

Read More

Problem with phpMyAdmin and PHP 7.2: “Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”

It’s possible that when you installed phpMyAdmin, the version in the repository (phpMyAdmin v4.6.6) was not fully compatible with PHP 7.2. There is a newer version available on the official website (v4.8 as of writing), which fixes these compatibility issues with PHP 7.2. sql.lib.php This error is caused by a line of code in /usr/share/phpmyadmin/libraries/sql.lib.php. If you […]

Read More

Create Swap space in ubuntu 18.04 aws

Your problem is related to the probable fact of having only 1gb of RAM and not having memory swap, so let’s create and enable it to take some time off at the time of composer execution. Folow this steps: 1) Creating 1gb memory swapfile: $ sudo fallocate -l 1G /swapfile $ sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576 This command […]

Read More

http to https www redirect

1. Redirect All Web Traffic If you have existing code in your .htaccess, add the following: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L] 2. Redirect Only a Specific Domain For redirecting a specific domain to use HTTPS, add the following: RewriteEngine On RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L] […]

Read More

which language is best for socket programming

It really depends on what you mean by network programming. So I’ll run through a couple possibilities. Commentators: Don’t fret if I forgot “your language.” The question is so open-ended. It’s like asking ‘What kinds of vehicles are good for getting me from New York City to Boston?’ You want to write a program that […]

Read More

5 Best Programming Languages to Learn for Cyber Security

1. C and C++ C and C++ are critical low-level programming languages that you need to know as a cyber security professional. These languages provide access to low-level IT infrastructure such as RAM and system processes, which if not well protected, hackers can easily exploit. The C programming language is the backbone of most operating systems. […]

Read More

how whatsapp qr code works

Step 1) Browser sends hello message to Node.js server using Websocket. Step 2) Node.js server generates a unique identifier and sends to browser using Websocket. Then browser generates a QR code using unique identifier and shows to user. Step 3) User login to the mobile app using Facebook authentication. Step 4) After the successful authentication, user scans the QR […]

Read More