This file contains 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
export const isValidLuhn = (input) => { | |
if (!/^\d+$/.test(input)) { | |
return false; | |
} | |
const arr = input | |
.split('') | |
.reverse() | |
.map((x) => parseInt(x, 10)); | |
const lastDigit = arr.splice(0, 1)[0]; |
This file contains 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
<!-- | |
Source set to choose differently sized images depending on device | |
This is a scenario where large screens have a 500px wide image, | |
medium screens a 350px wide image, and small screens a 250px wide | |
image. It is then up to the browser to select the correct image | |
based on pixel density (1000w image for the 500px container if on | |
a 2x retina display, for example). | |
https://codepen.io/perenstrom/pen/JjbMvMa | |
--> |
This file contains 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
<?php | |
// Define variables | |
$dbuser = 'user'; | |
$dbpassword = 'pass'; | |
$dbname = 'dbname'; | |
$hostname = 'host'; | |
$port = 8889; | |
// Open database connection |