This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getAge(DOB) { | |
| var today = new Date(); | |
| var birthDate = new Date(DOB); | |
| var age = today.getFullYear() - birthDate.getFullYear(); | |
| var m = today.getMonth() - birthDate.getMonth(); | |
| if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { | |
| age = age - 1; | |
| } | |
| return age; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import csvToMarkDownTable from 'csv-to-markdown-table'; | |
| const style = { | |
| markdownTableWrapper: { | |
| padding: '0', | |
| margin: '0', | |
| listStyle: 'none', | |
| display: 'flex', | |
| flexDirection: 'column', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"version":1,"resource":"file:///home/asmattic/Desktop/dev/asmattic/matt-oldfield-portfolio/public/manifest.webmanifest","entries":[{"id":"S9Dc.webmanifest","timestamp":1662583882074}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let links = document.querySelectorAll('a') | |
| // check if link is external | |
| const currentHostname = window.location.hostname | |
| // If has subdomain, split that off | |
| const sliceSubdomain = currentHostname.slice(currentHostname.indexOf('.') + 1) | |
| const hostname = (sliceSubdomain.includes('.')) ? sliceSubdomain : currentHostname | |
| // Add target="_blank" to external links | |
| links.forEach(link => { | |
| const href = link.getAttribute('href') | |
| // Could be some more checking for internal links that don't have hostname |
NewerOlder