Skip to content

Instantly share code, notes, and snippets.

View jamesrichards's full-sized avatar
✌️

James Richards jamesrichards

✌️
View GitHub Profile
@matthewbeta
matthewbeta / visuallyhidden.css
Last active August 29, 2015 14:25 — forked from sousk/gist:1280108
Hide Visually HTML5 BP style
/* Hide only visually, but have it available for screenreaders: h5bp.com/v */
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
@ShirtlessKirk
ShirtlessKirk / luhn.js
Last active February 12, 2024 05:09
Luhn validation algorithm
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,