This file contains hidden or 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
(function () { | |
'use strict'; | |
var doc = this.document, | |
i, inputs, input, options, rand; | |
if (!doc.querySelectorAll) return; | |
inputs = doc.querySelectorAll('input[list]'); |
This file contains hidden or 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
# 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" | |
} |
This file contains hidden or 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
// [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); |
NewerOlder