Skip to content

Instantly share code, notes, and snippets.

View ekorneeff's full-sized avatar

Eugene Korneev ekorneeff

View GitHub Profile
database:
- cp mongoid.yml.example mongoid.yml
services:
- redis
- mongodb
- elasticsearch
@ekorneeff
ekorneeff / queue.coffee
Last active December 15, 2015 13:49
ajax queue for js
class AjaxQueue
@MAX = 40
constructor: () ->
@requests = []
@current = 0
ajax: (opts) ->
opts.complete = (jqXHR, textStatus) =>
@current -= 1
@ekorneeff
ekorneeff / faye.ru
Created September 15, 2012 20:10
Faye online/offline status to Rails via Redis
# Run with: rackup faye.ru -s thin -E production
# For executor-customer chat
require "bundler/setup"
require "faye"
require 'redis'
require 'redis/objects'
Redis.current = Redis.new(:host => '127.0.0.1', :port => 6379)
Faye::WebSocket.load_adapter('thin')