Skip to content

Instantly share code, notes, and snippets.

@CoAmA
CoAmA / install_rsync.ps1
Created October 13, 2024 10:24 — forked from LuisEGR/install_rsync.ps1
Install rsync in Windows 11, easy
# Download and install Git for Windows if not already installed
if (-not (Test-Path "C:\Program Files\Git\bin\git.exe")) {
Write-Host "Git for Windows not found. Downloading installer..."
Invoke-WebRequest -Uri "https://github.com/git-for-windows/git/releases/download/v2.31.1.windows.1/Git-2.31.1-64-bit.exe" -OutFile "git-installer.exe"
Write-Host "Installing Git for Windows..."
Start-Process -FilePath ".\git-installer.exe" -ArgumentList "/VERYSILENT" -Wait
Remove-Item ".\git-installer.exe"
}
# Create a temporary directory for downloads

Smooth scroll to top of page

If you need a plain JavaScript function to add a smooth scrolling back to the top of the page, you can use this script.

  1. Add an id of "top" to the body
  2. Add the onclick function to the link
  3. Include the JavaScript function in your HTML file, preferrably at the bottom before the closing </body> tag if possible. Since this script is not part of the UI it can load last and will not negatively affect the user experience or usability of the page.

Author: Marco Del Corno - http://thewebthought.blogspot.com/2012/06/javascript-smooth-scroll-to-top-of-page.html