This file contains 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
@import compass/utilities/sprites/base | |
// General Sprite Defaults | |
// You can override them before you import this file. | |
$rocky16-sprite-base-class: ".rocky16-sprite" !default | |
$rocky16-sprite-dimensions: false !default | |
$rocky16-position: 0% !default | |
$rocky16-spacing: 0 !default | |
$rocky16-repeat: no-repeat !default | |
$rocky16-prefix: "" !default |
This file contains 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
Unit.prototype.toJSON = function(){ | |
var copy = ko.toJS(this) | |
copy.content_ids = _.map(copy.contents, function(content){return content.id}) | |
copy.children_ids = _.map(copy.units, function(unit){return unit.id}) | |
return { | |
course_slug : course_slug | |
id : copy.id | |
,title : copy.title | |
,subtitle : copy.subtitle |
This file contains 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
var addTrackers = function(vm, vms){ | |
vm.units = ko.dependentObservable(function(){ | |
if (vms.unit() !== undefined){ | |
_.each(vms.unit().dirtyUnits(), function(unit){ | |
unit.save(vms.course) | |
unit.dirtyFlag.reset() | |
}) | |
} | |
}) | |
vm.unit = ko.dependentObservable(function(){ |
This file contains 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
In short, the tracking of the dirty units stops working. | |
Scenario: | |
1. User hits the "show_course" route which loads a course then loads the first unit. | |
2. User then clicks on a new unit and hits the "show_unit" course. | |
3. User then clicks a link which takes them to the "show_course" route. | |
When they hit 3, the change tracking stops working. Why is this? In addition, when I call App.VMs.unit().dirtyUnits.getSubscriptionsCount(), the count goes up after each time a user hits "show_course" or "show_unit." It appears the subscriptions and the dependentObservables are just sticking around even though the unit they're observing has been changed. | |
Any ideas how to do this? |
This file contains 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
# utilities > carrierwave > storage > fog.rb | |
# utilities is in my autoload path | |
# after this, carrierwave ceased to work. I commented out the method, still nothing. | |
# it appears that the class completely clobbers the existing class.... | |
module CarrierWave | |
module Storage | |
class Fog < Abstract | |
class File |
This file contains 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
App.Router = Backbone.Router.extend({ | |
routes : { | |
"" : "home" | |
,"/" : "home" | |
,"!" : "home" | |
,"!/" : "home" | |
,"!/:username" : "show_user" | |
,":username" : "show_user" | |
,":username/" : "show_user" |
This file contains 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
/Users/ScottMessinger/.rvm/gems/ruby-1.9.2-p180-patched@rails31/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419: stack level too deep (SystemStackError) | |
rake aborted! | |
/Users/ScottMessinger/.rvm/gems/ruby-1.9.2-p180-patched@rails31/gems/rspec-core-2.6.4/lib/rspec/core/rake_task.rb:139:in `rescue in block (2 levels) in initialize' | |
/Users/ScottMessinger/.rvm/gems/ruby-1.9.2-p180-patched@rails31/gems/rspec-core-2.6.4/lib/rspec/core/rake_task.rb:135:in `block (2 levels) in initialize' | |
/Users/ScottMessinger/.rvm/gems/ruby-1.9.2-p180-patched@global/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:57:in `verbose' | |
/Users/ScottMessinger/.rvm/gems/ruby-1.9.2-p180-patched@rails31/gems/rspec-core-2.6.4/lib/rspec/core/rake_task.rb:131:in `block in initialize' | |
/Users/ScottMessinger/.rvm/gems/ruby-1.9.2-p180-patched@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' | |
/Users/ScottMessinger/.rvm/gems/ruby-1.9.2-p180-patched@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute' | |
/Users/ScottMessinger/.rvm/gems |
This file contains 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
class Document | |
mount_uploader :doc, DocumentUploader | |
def auth_url | |
self.doc.file.authenticated_url | |
end | |
def public_url | |
self.doc.file.url |
This file contains 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
// THIS: | |
<script type="text/javascript"> | |
var src_app = "<%=javascript_path('application')%>"; | |
var src_frm = "<%=javascript_path('frameworks')%>"; | |
var src_tiny = "<%=javascript_path('tiny_mce/tiny_mce_joined')%>"; | |
</script> | |
// PRODUCES THIS: | |
<script type="text/javascript"> |
This file contains 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
CURRICULUM PUBLISHING APP | |
========================= | |
This is a rough estimate of the number of items on a reasonably complex page. The document data might be delivered as one big JSON blob or as separate JSON arrays and combined client side. | |
BASIC OUTLINE | |
============= | |
A curriculum has three tiers | |
Unit > Concept > Lesson |