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
class SearchSuggestion | |
def self.terms_for(prefix) | |
return if prefix.blank? | |
puts "prefix:#{prefix}" | |
prefix_array = prefix.split | |
puts prefix_array | |
unless prefix_array.empty? | |
$redis.zinterstore "$tmp",prefix_array | |
terms = $redis.zrevrange "$tmp", 0, 4 |
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
GET /data/attachment/audioimg/8/143410hpzqo0oo5o2oimxm.jpg HTTP/1.1 - 15/Mar/2013:04:48:03 +0800 200 0.000 21863 21863 58.33.250.146 - - - - - iListen/1.5.01290 CFNetwork/609.1.4 Darwin/13.0.0sendfileon | |
GET /data/attachment/audioimg/0/141236mm3tlwv1wxrwhswr.jpg HTTP/1.1 - 15/Mar/2013:04:48:03 +0800 200 0.000 16130 16130 58.33.250.146 - - - - - iListen/1.5.01290 CFNetwork/609.1.4 Darwin/13.0.0sendfileon | |
GET /data/attachment/audioimg/0/142535uk7ee7uuuv6f7mh7.jpg HTTP/1.1 - 15/Mar/2013:04:48:03 +0800 200 0.000 26645 26645 58.33.250.146 - - - - - iListen/1.5.01290 CFNetwork/609.1.4 Darwin/13.0.0sendfileon | |
GET /data/attachment/audioimg/7/1705281f9seimc95gz544d.jpg HTTP/1.1 - 15/Mar/2013:04:48:04 +0800 200 1.440 24675 24675 112.78.65.211 - - - - - Dalvik/1.6.0 (Linux; U; Android 4.1.1; MI 2 MIUI/JLB12.0)sendfileon | |
GET /data/attachment/audio/0/143734o88bfyydy9aka5d8.audio HTTP/1.1 - 15/Mar/2013:04:48:04 +0800 206 44.649 1240599 1240599 87.0.131.142 - - - - - \xE6\x95\x85\xE4\xBA\x8B\xE5\x8F\xA3\xE8\xA2\x8B\xE5\x90\x |
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
class AdminUser < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, | |
:recoverable, :rememberable, :trackable, :validatable | |
# Setup accessible (or protected) attributes for your model | |
attr_accessible :email, :login, :password, :password_confirmation, :remember_me | |
attr_accessor :login |
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
require 'rubygems' | |
require 'coderay' | |
tokens = CodeRay.scan <<-'CODE', :ruby | |
puts %[Hello, world!] | |
puts "Here\'s some #@@weird #{ { :code => "for you" } }" | |
CODE | |
print tokens.div(:line_numbers => :table, :css => :class) |
NewerOlder