Skip to content

Instantly share code, notes, and snippets.

@stanzheng stanzheng/norfolk.js
Created Feb 19, 2014

What would you like to do?
NorfolkJS: Sharpen Your Saw. PT:II
Steve Hackbarth @2014
var _ = require("underscore"),
fs = require("fs");
var isLeftHanded = function (s) {
return _.every(s.toLowerCase(), function (l) {
return _.contains('qwertasdfgzxcvb', l);
fs.readFile("/usr/share/dict/words", "utf8", function (err, contents) {
var words = contents.split("\n");
var leftHandedWords = _.filter(words, isLeftHanded);
var sortedWords = _.sortBy(leftHandedWords, function (word) {
return -1 * word.length;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.