Skip to content

Instantly share code, notes, and snippets.

@superlou
superlou / Output
Created March 19, 2012 01:04
Undefined 'name' for nil:NilClass
#<Tag:0x00000005002fd0>
New Con
NoMethodError: undefined method `name' for nil:NilClass
/home/lsimons/RubymineProjects/connie/app/models/con.rb:16:in `rename_tag'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `_run__1766852513517797900__save__1160347338664056617__callbacks'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
class Rule < ActiveRecord::Base
* implements satisfied?
* implements message
* belongs_to a "ruleable" object (object you can apply a rule, to polymorphic)
class RoomMustHaveCapacityRule < Rule
* has an integer value "capacity"
* satisfied if rule is applied to a Room model who's seating capacity is >= the rule's capacity
* message indicates "success" or "failure by [how much]"
@superlou
superlou / Trace
Created April 22, 2012 22:07
Mocking a child object
ActiveRecord::AssociationTypeMismatch: TimeSpan(#38173560) expected, got Mocha::Mock(#20908400)
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.2/lib/active_record/associations/association.rb:204:in `raise_on_type_mismatch'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.2/lib/active_record/associations/has_one_association.rb:8:in `replace'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.2/lib/active_record/associations/singular_association.rb:17:in `writer'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.2/lib/active_record/associations/builder/association.rb:51:in `block in define_writers'
/home/lsimons/RubymineProjects/connie/test/unit/duration_rule_test.rb:34:in `block (2 levels) in <class:DurationRuleTest>'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/shoulda-context-1.0.0/lib/shoulda/context/context.rb:398:in `call'
/home/lsimons/.rvm/gems/ruby-1.9.2-p290/gems/shoulda-context-1.0.0/lib/shoulda/context/context.rb:398:in `block in create_test_from_sh
@superlou
superlou / Console Log
Created June 3, 2012 19:11
Bootstrap Typeahead not seeing options
Object
provide: "typeahead"
typeahead: Typeahead
$element: jQuery.fn.jQuery.init[1]
$menu: jQuery.fn.jQuery.init[1]
highlighter: function (item) {
matcher: function (item) {
options: Object
shown: false
sorter: function (items) {
@superlou
superlou / gist:3030394
Created July 2, 2012 01:38
Constructor returned NULL on making ghost pad
GStreamer 1.0.0
<Pad object at 0x2b73230 (GstPad at 0x2bc60d0)>
(main.py:4385): GStreamer-CRITICAL **: gst_ghost_pad_new: assertion `!gst_pad_is_linked (target)' failed
Traceback (most recent call last):
File "main.py", line 46, in <module>
Main().run()
File "main.py", line 21, in __init__
self.station = station.Station()
File "/home/lsimons/open-playout/station.py", line 19, in __init__
@superlou
superlou / Debug Output from the view
Created July 16, 2012 01:27
Reservations fields_for
--- !ruby/object:Reservation
attributes:
id:
event_id: 1231
reservable_type:
reservable_id:
created_at:
updated_at:
inherit_time_span: true
@superlou
superlou / Log
Created August 9, 2012 23:57
Paperclip Upload "No file chosen" (fixed)
Started POST "/spaces/1/maps" for 127.0.0.1 at 2012-08-09 19:59:07 -0400
Processing by MapsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"LWOp0AQARd2EzN+ls+DocIXcuexaRQQt8tCMjh+M1QY=", "map"=>{"space_id"=>"1", "imag
e"=>#<ActionDispatch::Http::UploadedFile:0x000000031c87e0 @original_filename="cartoon.jpg", @content_type="image/jpeg", @headers
="Content-Disposition: form-data; name=\"map[image]\"; filename=\"cartoon.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<Fi
le:/tmp/RackMultipart20120809-11699-175s08t>>}, "commit"=>"Create Map", "space_id"=>"1"}
@superlou
superlou / schema.xml
Created August 23, 2012 23:36
Solr not matching Space with name of "Panel 1". "Panel " does match. Resolution: Didn't restart server before reindexing.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@superlou
superlou / gist:3719158
Created September 14, 2012 01:07
gst-plugins-bad build error
make -C videoparsers
make[3]: Entering directory `/home/lsimons/gst/master/gst-plugins-bad/gst/videoparsers'
CC libgstvideoparsersbad_la-gstdiracparse.lo
gstdiracparse.c: In function 'gst_dirac_parse_init':
gstdiracparse.c:138:3: error: implicit declaration of function 'gst_base_parse_set_pts_interpolation' [-Werror=implicit-function-declaration]
gstdiracparse.c:138:3: error: nested extern declaration of 'gst_base_parse_set_pts_interpolation' [-Werror=nested-externs]
cc1: all warnings being treated as errors
make[3]: *** [libgstvideoparsersbad_la-gstdiracparse.lo] Error 1
make[3]: Leaving directory `/home/lsimons/gst/master/gst-plugins-bad/gst/videoparsers'
make[2]: *** [videoparsers] Error 2
@superlou
superlou / Console Output
Last active December 11, 2015 16:58
Minitest Reporters not working after upgrading to Rails 3.2. Adding the line `MiniTest::Reporters.use!` to test_helpers.rb results in tests not being reported properly. They work again when the line is removed.
lsimons@bestever ~/RubymineProjects/connie $ rake test TEST=test/unit/address_test.rb
NOTICE: CREATE TABLE will create implicit sequence "addresses_id_seq" for serial column "addresses.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "addresses_pkey" for table "addresses"
NOTICE: CREATE TABLE will create implicit sequence "assignees_id_seq" for serial column "assignees.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "assignees_pkey" for table "assignees"
NOTICE: CREATE TABLE will create implicit sequence "auth_requirements_id_seq" for serial column "auth_requirements.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "auth_requirements_pkey" for table "auth_requirements"
NOTICE: CREATE TABLE will create implicit sequence "be_scheduled_rules_id_seq" for serial column "be_scheduled_rules.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "be_scheduled_rules_pkey" for table "be_scheduled_rules"
NOTICE: CREATE TABLE will create implicit seq