Answers for "location objects javascript"

5

clear swap memory linux

sudo swapoff -a; sudo swapon -a
Posted by: Guest on September-11-2020
2

linux swap flush

#!/bin/bash

free_mem="$(free | grep 'Mem:' | awk '{print $7}')"
used_swap="$(free | grep 'Swap:' | awk '{print $3}')"

echo -e "Free memory:\t$free_mem kB ($((free_mem / 1024)) MiB)\nUsed swap:\t$used_swap kB ($((used_swap / 1024)) MiB)"
if [[ $used_swap -eq 0 ]]; then
    echo "No swap is in use."
elif [[ $used_swap -lt $free_mem ]]; then
    echo "Freeing swap..."
    sudo swapoff -a
    sudo swapon -a
else
    echo "Not enough free memory. Exiting."
    exit 1
fi
Posted by: Guest on October-09-2020
1

javascript location object

// Prints complete URL
window.location.href
  
// Prints protocol like http: or https:
window.location.protocol 
 
// Prints hostname with port like localhost or localhost:3000
window.location.host
  
// Prints hostname like localhost or www.example.com
window.location.hostname
 
// Prints port number like 3000
window.location.port
  
// Prints pathname like /products/search.php
window.location.pathname
 
// Prints query string like ?q=ipad
window.location.search
 
// Prints fragment identifier like #featured
window.location.hash
Posted by: Guest on September-08-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language