Skip to content

Instantly share code, notes, and snippets.

View kresnasatya's full-sized avatar
🤫
Shh!

Kresna Satya kresnasatya

🤫
Shh!
View GitHub Profile
@kresnasatya
kresnasatya / browser-check.js
Last active May 27, 2024 20:54
How to detect browser and it's version using UA-Parser (User Agent Parser)
// First, put UA-Parser-JS CDN
<script src="https://cdn.jsdelivr.net/npm/ua-parser-js@0/dist/ua-parser.min.js"></script>
<script>
// Second, instantiate UAParser
const parser = new UAParser();
const parserResult = parser.getResult();
const browserName = parserResult.browser.name;
const browserVersion = parseInt(parserResult.browser.version.split('.')[0], 10);
let STANDARD_VERSION;
console.log(parserResult);
@kresnasatya
kresnasatya / address.html
Last active March 10, 2019 12:24
HTML Semantics
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Address - Web Semantics</title>
</head>
<body>
<footer>
@kresnasatya
kresnasatya / header.html
Created March 22, 2019 04:18
Header tag
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Header - Web Semantics</title>
</head>
<body>
<!-- Voice over will read "header" as a "banner" on Chrome and Safari -->
@kresnasatya
kresnasatya / nav.html
Created March 22, 2019 04:24
Navigation tag
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Navigation - Web Semantic</title>
</head>
<body>
<!-- Voice over will read "nav" tag as navigation on Chrome and Safari -->
@kresnasatya
kresnasatya / aside.html
Created March 22, 2019 04:33
Aside tag
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Aside - Web Semantics</title>
</head>
<body>
<p>My family and I visited The Epcot center this summer.</p>
@kresnasatya
kresnasatya / details-summary.html
Last active March 22, 2019 04:35
Details and Summary tags
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Details and summary - Web Semantic</title>
</head>
<body>
@kresnasatya
kresnasatya / figure-figcaption.html
Created March 22, 2019 04:35
Figure and Figcaption tags
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Figure-figcaption - Web Semantics</title>
</head>
<body>
<h2>Places to Visit</h2>
@kresnasatya
kresnasatya / footer.html
Created March 22, 2019 04:36
Footer tag
@kresnasatya
kresnasatya / time.html
Created March 22, 2019 04:36
Time tag
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Time - Web Semantics</title>
</head>
<body>
<article>
@kresnasatya
kresnasatya / address.html
Created March 22, 2019 04:37
Address tag
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Address - Web Semantics</title>
</head>
<body>
<footer>