This file contains 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
# application.rb | |
module Merb | |
class Request | |
def account | |
subdomains(0).first | |
end | |
end | |
end | |
# router.rb |
This file contains 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
module.exports = function(redisClient,prefix) { | |
var Autocomplete = {}; | |
Autocomplete.prefix = prefix; | |
Autocomplete.terminal = "+"; | |
Autocomplete.add = function(word, next) { | |
function add(letters, key, last, x) { | |
var letter = last ? Autocomplete.terminal : letters[x]; | |
var score = last ? 0 : letter.charCodeAt(0); |