Skip to content

Instantly share code, notes, and snippets.

View thatanjan's full-sized avatar

Anjan Shomodder thatanjan

View GitHub Profile
@jserrao
jserrao / url-segment.js
Created July 27, 2016 14:41
Get Last Segment of a URL in Javascript
var pageURL = window.location.href;
var lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
console.log(lastURLSegment);
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 28, 2024 00:00
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ricardozea
ricardozea / Smooth scroll to top of page.markdown
Last active October 28, 2022 08:44
Smooth scroll to top of page

Visit the new improved script here! Smooth scroll to top of page (Improved!)


Smooth scroll to top of page (Legacy!)

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> tag. Like this: <body id="top">
  2. Add the onclick function to the link. Like this: <a href="#top" onclick="scrollToTop(); return false">Back to Top ↑</a>