Skip to content

Instantly share code, notes, and snippets.

View jsatk's full-sized avatar
💀

Jesse Atkinson jsatk

💀
View GitHub Profile
(function () {
'use strict';
var doc = this.document,
i, inputs, input, options, rand;
if (!doc.querySelectorAll) return;
inputs = doc.querySelectorAll('input[list]');
# JS Lint
# Reference: http://blog.simplytestable.com/installing-jslint-for-command-line-use-on-ubuntu/
function jslint {
filename=${1##*/} # Name of file.
dir="/Users/Jesse/Desktop/" # Directory where you want your lint files output. Must be full path. No ~.
path="$dir$filename-lint.js"
/usr/local/bin/node /usr/share/node-jslint/node_modules/jslint/bin/jslint.js "$1" > "$path"
}
// [Sieve of Eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
var getPrimes = function (max) {
"use strict";
var sieve = [],
primes = [];
for (var i = 2; i <= max; i += 1) {
if (!sieve[i]) {
primes.push(i);