Skip to content

Instantly share code, notes, and snippets.

/usr/lib/ruby/gems/1.8/gems/virtualbox-0.7.5/lib/virtualbox/abstract_model/interface_attributes.rb:93:in `send': undefined method `status' for nil:NilClass (NoMethodError)
kelly@fujin:$ vagrant up
[default] VM already created. Booting if its not already running...
[default] Provisioning enabled with Vagrant::Provisioners::ChefSolo...
The specified host network collides with a non-hostonly network!
This will cause your specified IP to be inaccessible. Please change
the IP or name of your host only network to not match that of
a bridged or non-hostonly network.
@kellydunn
kellydunn / ajax + otrack
Created November 1, 2010 20:10
ajax + otrack
// AJAX resource creation / deletion
// Currently follow's Rudy's conventions
function add_resource_by_listeners() {
$("#resource_submit").click(function(e){ // listen to the feature specific submit button
e.preventDefault();
var ajax_data = {
update_action : "create_resource", // "create_" + feature
@kellydunn
kellydunn / ye
Created November 2, 2010 05:34
ye
def process_json_update(params)
if params[:update_action] == "create_resource"
resource = Resource.new(params[:resource])
resource.project_id = self.id
if resource.save
json = {:result => "success", :resource=>resource.attributes}
else
json = {:result => "failure", :errors=>"Could not save resource"}
end
@kellydunn
kellydunn / billing_reports_controller dump
Created November 2, 2010 05:40
billing_reports_controller dump
(rdb:296) @adjusted_hours
{#<User id: 706, name: "Foo Bar Admin", email: "foo.bar.admin@originatelabs.com",
created_at: "2010-11-02 05:28:13", updated_at: "2010-11-02 05:28:13",
crypted_password: "e72fe3e28f83ac43157b899d9eaaab20bff0a8a15f7cf490cc8...",
password_salt: "2FZjkt9EYnpNAfDUzDzv",
persistence_token: "d54459ec64a19c8ecd1c3ba30135c1408f8c5a40293f53195c0...",
role_name: "admin", receives_email: true, location_id: 702>=>0.0,
#<User id: 707, name: "John Doe", email: "john.doe@originatelabs.com",
created_at: "2010-11-02 05:28:17", updated_at: "2010-11-02 05:28:17",
@kellydunn
kellydunn / board controller
Created November 19, 2010 23:43
gotta get that board board board
def solve
@guess = Board.from_hash(params[:solution])
if @board.partial_solution?(@guess)
current_user.current_user_game_board.score!
flash[:notice] = "Your answer matched the solution!"
else
current_user.current_user_game_board.missed_guess
flash[:alert] = "Your answer was wrong!"
end
@kellydunn
kellydunn / gist:721217
Created November 30, 2010 05:40
vagrant woes :'(
* Starting NFS kernel daemon [ OK ]
[default] Creating shared folders metadata...
[default] Preparing host only network...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Enabling host only network...
[default] Forcing shutdown of VM...
[default] Disabling host only networks...
[default] Destroying VM and associated drives...
@kellydunn
kellydunn / gist:721221
Created November 30, 2010 05:45
more woes
[default] Creating shared folders metadata...
[default] Preparing host only network...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Enabling host only network...
[default] Mounting shared folders...
[default] -- v-csc-0: /tmp/vagrant-chef/cookbooks-0
[default] Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
@kellydunn
kellydunn / gist:722522
Created November 30, 2010 22:14
active record validation failure upon joining game
vagrant@vagrantup:/vagrant$ bundle exec rspec spec/integration/boards/show_spec.rb
..F..
Failures:
1) Showing Boards should start the countdown to match the server timer
Failure/Error: @user.join_game!(@game)
Validation failed: User has already been taken
# ./app/models/user.rb:30:in `join_game!'
# ./spec/integration/boards/show_spec.rb:59
@kellydunn
kellydunn / Rassul's Java Lessons 1 : Variables
Created December 10, 2010 19:06
Rassul's Java Lessons 1 : Variables
public static void letsLearnJava() {
int x = 2;
int y = 2;
int z = x + y;
// The println function is smart enough to wrap the int value into a String variable :)
System.out.println(z); // prints "4".
}
// Less redundant. You don't need the z variable.