Skip to content

Instantly share code, notes, and snippets.

module MongoidAdapter
class InstanceAdapter < Sunspot::Adapters::InstanceAdapter
def id
@instance.id
end
end
class DataAccessor < Sunspot::Adapters::DataAccessor
def load(id)
@clazz.find(id)
@iwarshak
iwarshak / gist:340433
Created March 22, 2010 19:24
gists for mongo mapreduce post
class Book
include MongoMapper::Document
CONTEXTS = ['authors', 'rating','keywords', 'genre']
CONTEXTS.each do |context|
key context, Array, :index => true
end
key :title, String<br />
key :contexts, Array<br />
@iwarshak
iwarshak / mongo_map_reduce_facets.rb
Created March 22, 2010 18:54
gists for mongo sharding post
require 'rubygems'
require 'mongo_mapper'
MongoMapper.connection = Mongo::Connection.new('localhost')
MongoMapper.database = 'books'
class Book
include MongoMapper::Document
CONTEXTS = ['authors', 'rating','keywords', 'genre']
CONTEXTS.each do |context|
class Base
end
class A < Base
end
class Base
class << self
attr_accessor :bar
end
@iwarshak
iwarshak / cassandra-2.xml
Created March 11, 2010 20:40
xml snippet for cassandra post
<ReplicationFactor>2</ReplicationFactor>
<ListenAddress>127.0.0.1</ListenAddress>
<CommitLogDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/commitlog</CommitLogDirectory>
<DataFileDirectories>
<DataFileDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/data</DataFileDirectory>
</DataFileDirectories>
<CalloutLocation>/path/to/cassandra/bin/var.1/lib/cassandra/callouts</CalloutLocation>
<StagingFileDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/staging</StagingFileDirectory>
<ThriftAddress>127.0.0.1</ThriftAddress>
@iwarshak
iwarshak / cassandra-1.xml
Created March 11, 2010 20:39
xml snippet for cassandra post
<ReplicationFactor>2</ReplicationFactor>
<ListenAddress>127.0.0.1</ListenAddress>
<CommitLogDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/commitlog</CommitLogDirectory>
<DataFileDirectories>
<DataFileDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/data</DataFileDirectory>
</DataFileDirectories>
<CalloutLocation>/path/to/cassandra/bin/var.1/lib/cassandra/callouts</CalloutLocation>
<StagingFileDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/staging</StagingFileDirectory>
<ThriftAddress>127.0.0.1</ThriftAddress>
[client]
socket=/tmp/mysql.sock
[mysqld]
socket=/tmp/mysql.sock
datadir=/Users/ian/Apps/mysql5
804d8f2 HEAD@{0}: checkout: moving from master to input_refactor_4664
422df39 HEAD@{1}: pull : Fast forward
804d8f2 HEAD@{0}: checkout: moving from master to input_refactor_4664
804d8f2 HEAD@{0}: checkout: moving from master to input_refactor_4664
422df39 HEAD@{1}: pull : Fast forward
95b1e56 HEAD@{2}: checkout: moving from 57bc4b4b0e698f808df979ceaec922777196aa03 to master
804d8f2 HEAD@{0}: checkout: moving from master to input_refactor_4664
422df39 HEAD@{1}: pull : Fast forward
95b1e56 HEAD@{2}: checkout: moving from 57bc4b4b0e698f808df979ceaec922777196aa03 to master
57bc4b4 HEAD@{3}: checkout: moving from input_refactor_4664 to 57bc4b4b0e698f808df979ceaec922777196aa03
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
Author: ian <ian@rightscale.com>
Date: Tue Sep 15 17:12:05 2009 -0500
refs #4568 - a deployment can have ST that do not belong to the account. do not be so restrictive on the STE (server template executabl
diff --git a/app/controllers/deployments_controller.rb b/app/controllers/deployments_controller.rb
index 09cd380..7a9a565 100644
--- a/app/controllers/deployments_controller.rb
+++ b/app/controllers/deployments_controller.rb
@@ -435,7 +435,7 @@ class DeploymentsController < ApplicationController