Skip to content

Instantly share code, notes, and snippets.

View mikeriley131's full-sized avatar

Mike Riley mikeriley131

View GitHub Profile
@mikeriley131
mikeriley131 / ordinal.js
Created October 12, 2016 18:53
number ordinal indicator
if (place.toString().substr(-1) === '1' && place !== 11) {
place = place + 'st'
}
else if (place.toString().substr(-1) === '2' && place !== 12) {
place = place + 'nd'
}
else if (place.toString().substr(-1) === '3' && place !== 13) {
place = place + 'rd'
}
else {
@mikeriley131
mikeriley131 / ios-double-tap.js
Last active September 19, 2017 21:51
Overcome the need to double-tap on a button with :hover:before or :hover:after on iOS
var styledLink = document.querySelectorAll('.button-link'),
i;
for (i = 0; i < styledLink.length; ++i) {
styledLink[i].addEventListener('touchend', function(e) {
window.location = this.attr('href');
})
}
const statesList = [
{
value: 'AL',
label: 'Alabama'
},
{
value: 'AK',
label: 'Alaska'
},
{