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
public virtual T GetByExpression<T>(Expression<Func<T, bool>> expression) where T : class | |
{ | |
var session = _sessionManager.OpenSession(); | |
var result = session.QueryOver<T>() | |
.Where(expression) | |
.SingleOrDefault(); | |
return result; | |
} |
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
desc "start_consumer", "start the test consumer" | |
def start_consumer | |
puts "Running #{AMQP::VERSION} version of the gem" | |
AMQP.start(:host => "localhost", :user => "guest", :password => "guest", :vhost => "/", | |
:logging => true, :port => 5672) do |connection| | |
channel = AMQP::Channel.new(connection) | |
requests_queue = channel.queue("one", :exclusive => true, :auto_delete => true) |
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
def publish(urlSearch, routing_key) | |
EM.run do | |
corr_id = rand(10_000_000).to_s | |
requests ||= Hash.new | |
connection = AMQP.connect(:host => "localhost") | |
callback_queue = AMQP::Channel.new(connection).queue("", :exclusive => true) |
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
source 'http://rubygems.org' | |
source 'http://gems.engineyard.com' | |
gem 'rails', '~> 3.1.3' | |
gem 'haml' | |
gem 'authlogic', :git => 'https://github.com/AndreasWurm/authlogic.git' | |
gem 'nokogiri' | |
gem 'bundler' | |
gem 'jquery-rails' | |
gem 'rake' |
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
desc "start_consumer", "start the test consumer" | |
def start_consumer | |
AMQP.start(:host => "localhost", :user => "guest", :password => "guest", :vhost => "/", | |
:logging => true, :port => 5672) do |connection| | |
channel = AMQP::Channel.new(connection) | |
requests_queue = channel.queue("one", :exclusive => true, :auto_delete => true) | |
Signal.trap("INT") do |
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
AMQP.start(conf) do |connection| | |
channel = AMQP::Channel.new(connection) | |
requests_queue = channel.queue("one", :exclusive => true, :auto_delete => true) | |
requests_queue.purge | |
Signal.trap("INT") do | |
connection.close do | |
EM.stop{exit} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using c2.bases.domain; | |
using NHibernate; | |
namespace c2.bases.dataaccess | |
{ | |
/// <summary> | |
/// Functionality for common simple data access. |
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 'thor' | |
require 'amqp' | |
require 'json' | |
# examples | |
# __dir = File.join(File.dirname(File.expand_path(__FILE__)), "..") | |
# require File.join(__dir, "example_helper") | |
# /Users/paulcowan/.rvm/gems/jruby-1.6.5/gems/amq-client-0.8.4/examples | |
module Worker | |
module App | |
module Cli |
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 'thor' | |
require 'amqp' | |
require 'json' | |
# examples | |
# __dir = File.join(File.dirname(File.expand_path(__FILE__)), "..") | |
# require File.join(__dir, "example_helper") | |
# /Users/paulcowan/.rvm/gems/jruby-1.6.5/gems/amq-client-0.8.4/examples | |
module Worker | |
module App | |
module Cli |
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 'tilt' | |
require 'json' | |
class EmberHandlebars < Tilt::Template | |
def self.default_mime_type | |
"application/javascript" | |
end | |
def prepare | |
end |