Skip to content

Instantly share code, notes, and snippets.

// Expand input of comma separated positive integers including ranges, into flat list of numbers.
var isValidRange = function(str, delimiter, rangeDelimiter) {
return new RegExp('^[0-9]+(?:' + rangeDelimiter + '[0-9]+)?(?:' + delimiter+ '[0-9]+(?:' + rangeDelimiter + '[0-9]+)?)*$', 'i').test(str);
}
var addRange = function(low,high, result) {
var i;
for (i = low; i <= high; i++) result.push(i);
return result;
}
@pmk65
pmk65 / corsproxy.txt
Created February 20, 2019 16:16
CORS Proxies
https://cors.io/?
https://jsonp.afeld.me/?url=
https://cors-anywhere.herokuapp.com/
@pmk65
pmk65 / typeahead.css
Created February 6, 2019 13:03
CSS for Twitter Typeahead plugin
.tt-query {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.tt-hint {
color: #999;
}
.tt-menu {
width: 100%;
min-width: 200px;
padding: 4px 0;
@pmk65
pmk65 / example.html
Created January 14, 2019 12:23
AJAX alternative to Server Side Includes
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<script type="text/javascript" src="includeHTML.js"></script>
</head>
<body>
@pmk65
pmk65 / printstyles.css
Created December 4, 2018 11:57
Default Print Stylesheet
/**
* Default Print Stylesheet
* Custom Classnames:
* noprint - Place on any element that should be excluded from print
* noprintlink - Place on A tag if you don't want the URL link displayed.
* Or on ABBR tag if you don't want the Title attribute displayed.
*
* Resources:
* https://www.smashingmagazine.com/2018/05/print-stylesheets-in-2018/
* https://www.smashingmagazine.com/2015/01/designing-for-print-with-css/