Skip to content

Instantly share code, notes, and snippets.

@scottshea
scottshea / CassandraInstall.md
Last active October 25, 2019 12:18
Cassandra Install Instructions

Cassandra Install on Digital Ocean

The systems

The 512 MB/1 CPU system is too small. The 1GB/1 CPU can technically run Cassandra but it is too small. You should likely start with 2GB/2 CPU systems but expect to upgrade.

Select them in the same region for right now.

I went with Ubuntu 14 and the commands here will presume that. The commands were done from the root account. This will also presume that you are doing a multi-node cluster (3 is

@scottshea
scottshea / gist:3739990
Created September 17, 2012 21:47
Partial with select changing
<%= form_for :asset, :url => {:controller => "import", :action => "asset_check", :format => :js }, :options => { :remote => true }, :html => {:method => :post, :class => "well form-horizontal"} do |f| %>
<%= f.submit "Check File", :class => "btn" %> </br>
<%= f.label 'Configuration', "Field Mapping:", :class => "control-label" %>
<div class="controls">
<%= f.select('csv_configurations', options_from_collection_for_select(@csv_configurations, "id", "name"), {:include_blank => true}, {:id => "csv_configuration", :onchange => "load_mapping(this.value)"}) %>
</div>
<% @csv.headers.each do |head| %>
<%= f.label head, head.humanize, :class => "control-label", :id => "#{head}_id" %>
<div class="controls">
@scottshea
scottshea / activate_users_controller.rb
Created July 10, 2012 18:06
Activate User Controller
class ActivateUsersController < ApplicationController
load_and_authorize_resource :class => false
before_filter :populate_roles, :only => [:new_user, :update_user]
# GET /users
# GET /users.xml
def index
@users = User.all
respond_to do |format|
def create_asset
@asset = Asset.new(:name => params[:name],
:description => params[:description],
:serial_number => params[:serial_number],
:asset_manufacturer_id => params[:asset_manufacturer_id],
:asset_model_id => params[:asset_model_id],
:image_filename => params[:image_filename])
respond_to do |format|
format.js
@scottshea
scottshea / gist:2968923
Created June 21, 2012 22:15
SubScreensController
class SubScreensController < ApplicationController
load_and_authorize_resource
active_scaffold :sub_screen do |conf|
end
end
@scottshea
scottshea / gist:2968909
Created June 21, 2012 22:13
Stack Trace
Using the default profile...
undefined method `klass' for nil:NilClass (NoMethodError)
/home/scott/.rvm/gems/ruby-1.9.3-p194@rails3/gems/activesupport-3.0.13/lib/active_support/whiny_nil.rb:48:in `method_missing'
/home/scott/.rvm/gems/ruby-1.9.3-p194@rails3/gems/activerecord-3.0.13/lib/active_record/reflection.rb:346:in `block in source_reflection'
/home/scott/.rvm/gems/ruby-1.9.3-p194@rails3/gems/activerecord-3.0.13/lib/active_record/reflection.rb:346:in `collect'
/home/scott/.rvm/gems/ruby-1.9.3-p194@rails3/gems/activerecord-3.0.13/lib/active_record/reflection.rb:346:in `source_reflection'
/home/scott/.rvm/gems/ruby-1.9.3-p194@rails3/gems/activerecord-3.0.13/lib/active_record/reflection.rb:407:in `derive_class_name'
/home/scott/.rvm/gems/ruby-1.9.3-p194@rails3/gems/activerecord-3.0.13/lib/active_record/reflection.rb:121:in `class_name'
/home/scott/.rvm/gems/ruby-1.9.3-p194@rails3/gems/activerecord-3.0.13/lib/active_record/reflection.rb:162:in `klass'
/home/scott/.rvm/gems/ruby-1.9.3-p194@rails3/gems/active_
@scottshea
scottshea / gist:2955482
Created June 19, 2012 17:39
Database.yml
# SQLite version 3.x
# gem install sqlite3
development:
adapter: mysql
encoding: utf8
reconnect: false
database: activate_development
pool: 5
user:
password:
@scottshea
scottshea / gist:2955448
Created June 19, 2012 17:33
Stack Trace for Rake Task failue
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called.
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Unknown alias: test
/home/scott/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:239:in `block in visit_Psych_Nodes_Alias'
/home/scott/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:239:in `fetch'
/home/scott/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:239:in `visit_Psych_Nodes_Alias'
require 'spec_helper'
describe DcpMeeting do
it { should have_one :checkpoint }
it { should belong_to :coach }
it { should belong_to :organization }
it_should_behave_like "Meeting Delegates"
it "should be made with blueprints" do
@scottshea
scottshea / dcp_meeting_spec.rb
Created May 11, 2012 22:21
dcp_meeting_spec
require 'spec_helper'
describe DcpMeeting do
it { should have_one :checkpoint }
it { should belong_to :coach }
it { should belong_to :organization }
it_should_behave_like "Meeting Delegates"
it "should be made with blueprints" do