Created
          October 17, 2012 13:37 
        
      - 
      
- 
        Save ryexley/3905564 to your computer and use it in GitHub Desktop. 
    How I organize my JavaScript code blog post code samples
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | (function (w) { | |
| w.Yarder = { | |
| Models : {}, | |
| Views : {}, | |
| Collections : {}, | |
| Routers : {}, | |
| Templates : {}, | |
| Api : { | |
| Resources : {} | |
| } | |
| }; | |
| _.extend(w.Yarder, Backbone.Events); | |
| }(this)); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // ... | |
| // third party scripts/libraries | |
| script(src='/javascripts/lib/underscore-min.js') | |
| script(src='/javascripts/lib/backbone-min.js') | |
| script(src='/javascripts/lib/handlebars.js') | |
| script(src='/javascripts/lib/json2.js') | |
| script(src='/javascripts/lib/moment.js') | |
| // app-specific scripts | |
| script(src='/javascripts/templates.js') | |
| script(src='/javascripts/yarder.js') | |
| script(src='/javascripts/api.js') | |
| script(src='/javascripts/routers.js') | |
| script(src='/javascripts/views.js') | |
| script(src='/javascripts/collections.js') | |
| script(src='/javascripts/models.js') | |
| script(src='/javascripts/start.js') | |
| // ... | 
  
    
      This file contains hidden or 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
    
  
  
    
  | (function (api, m, v) { | |
| v.doSomething = function () { | |
| var someModel = m.SomeModel(api.Resources.sampleUrl); | |
| // ... | |
| } | |
| }(Yarder.Api, Yarder.Models, Yarder.Views)); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment