Skip to content

Instantly share code, notes, and snippets.

View jawand's full-sized avatar
🐧
Focusing

Jawand Singh jawand

🐧
Focusing
  • Winnipeg, MB
View GitHub Profile
@jawand
jawand / index.html
Created May 13, 2019 08:24 — forked from graphicbeacon/index.html
Create a countdown timer in Dart
<div>
<strong id="days"></strong>
<strong id="hours"></strong>
<strong id="minutes"></strong>
<strong id="seconds"></strong>
</div>
@jawand
jawand / gist:a791c877c0d459f21af8a5754765740c
Created September 7, 2018 06:34 — forked from excalq/gist:2961415
Javacript: Set or Update a URL/QueryString Parameter, and update URL using HTML history.replaceState()
// Explicitly save/update a url parameter using HTML5's replaceState().
function updateQueryStringParam(param, value) {
baseUrl = [location.protocol, '//', location.host, location.pathname].join('');
urlQueryString = document.location.search;
var newParam = key + '=' + value,
params = '?' + newParam;
// If the "search" string exists, then build params from it
if (urlQueryString) {
keyRegex = new RegExp('([\?&])' + key + '[^&]*');