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
require 'rubygems' | |
require 'eventmachine' | |
require 'em-websocket' | |
require 'json' | |
class Connection | |
attr_accessor :socket, :user_id | |
def initialize(socket, user_id) | |
@socket = socket |
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
# Everything you need to do to get started with Rails 2.3.8 | |
# | |
# As of June 14th, 2010 @ 2:30 p.m. MST | |
# | |
# This gist now features instructions to get Rails 3 up and running with: | |
# - Ruby 1.8.7-p174 | |
# - Bundler 0.9.26 | |
# - Cucumber 0.8.0 | |
# - Rspec 1.3.0 + Rspec-Rails 1.3.2 | |
# - RVM |
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
user app; | |
worker_processes 2; | |
error_log /home/app/logs/nginx.error.log info; | |
events { | |
worker_connections 1024; | |
} | |
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
# app/models/post.rb | |
class Post | |
searchable :auto_index => false, :auto_remove => false do | |
text :title | |
text :body | |
end | |
after_commit :resque_solr_update |
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 Sunspot | |
class ResqueSessionProxy < Sunspot::SessionProxy::AbstractSessionProxy | |
attr_reader :original_session | |
delegate :config, :delete_dirty?, :dirty?, | |
:new_search, :search, | |
:new_more_like_this, :more_like_this, | |
:remove, :remove!, |
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
$LOAD_PATH << './lib' | |
require 'i18n.rb' | |
class Backend < I18n::Backend::Simple | |
include I18n::Backend::Metadata | |
end | |
# if string.respond_to?(:translation_metadata) |
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
require 'http-request' | |
require 'http' | |
require 'benchmark' | |
urls = [ | |
"http://www.lovelygirliebits.com/feeds/posts/default", | |
"http://www.51arch.com/feed/", | |
"http://mutelife.com/feed/", | |
"http://jacksonphillipsinc.com/Tools_of_Trade/Tools_of_the_Trade.xml", | |
"http://hrishimittal.com/rss", |
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
require 'http-request' | |
require 'http' | |
require 'benchmark' | |
# "http://jacksonphillipsinc.com/Tools_of_Trade/Tools_of_the_Trade.xml", | |
# "http://hrishimittal.com/rss", | |
# "http://octave.dk/feed/", | |
# "http://montreal.kijiji.ca/f-SearchAdRss", | |
# "http://blog.alezaa.com/rss", | |
# "http://www.bizbash.com/rss/news.xml", |
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
require 'jruby' | |
require 'http-request' | |
# require 'http' | |
require 'benchmark' | |
require 'http_client' | |
# require './async-http-client-1.7.12.jar' | |
# require './slf4j-log4j12-1.7.5.jar' | |
# require './async-http-client-1.6.1.jar' |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5HxyZAXbtya8XD6Capt+0BqIDyGwGoXyBadoYDQsgVlboY/J9YtQS8916qUVQ/3MIyBOsaw3aqiUeA0YiSlkinR7x9PCn3Btcmag1PWs5KiFxtzDZiKpltsu8xPqg7oo+XEfDklraF4UVMs4ic+/4d45WuZhkPk9j2wD+ipBqgS/piNHQGUM/fcj13f9M3l6DMp5af/aJhpH9LXqj98zbl2bB25RLpYSlH0He1qkUsQRULo+0X3wMwhVsbY+hz9jmzcuXwzq+jhDk9OFo5kiOBcQyDsExo4FwXs5MFvhlNv4FhJ0q0jm+kOE1oONG/sjDaK/lPzsTZgT680PPG2qX haifeng.cao@nulayer.com |
OlderNewer