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
# Based on https://gist.github.com/jmeas/7992474cdb1c5672d88b | |
radioShim = ( root, factory ) -> | |
if typeof define is 'function' and define.amd | |
define [ | |
'backbone.marionette' | |
'backbone.radio' | |
'underscore' | |
], ( Marionette, Radio, _ ) -> | |
factory Marionette, Radio, _ |
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
module.exports = ( grunt, options ) -> | |
app: | |
options: | |
bare: true | |
sourceMap: true | |
expand: true | |
cwd: 'coffee' | |
src: '**/*.coffee' | |
dest: 'js' | |
ext: '.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
Marionette.Region.prototype.show = function(view, options) { | |
var forceShow, isChangingView, isDifferentView, preventDestroy, replaceElement, showOptions, _shouldDestroyView, _shouldReplaceElement, _shouldShowView; | |
this._ensureElement(); | |
showOptions = options || {}; | |
isDifferentView = view !== this.currentView; | |
preventDestroy = !!showOptions.preventDestroy; | |
forceShow = !!showOptions.forceShow; | |
replaceElement = !!showOptions.replaceElement; |
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
define(['backbone.intercept', 'marionette'], function(BackboneIntercept, Marionette) { | |
var App; | |
return App = (function(_super) { | |
__extends(App, _super); | |
function App() { | |
return App.__super__.constructor.apply(this, arguments); | |
} | |
App.prototype.onStart = function() { |
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
{"title":"Backbone.Marionette - replaceElement","author":"trezy","pages":[{"pageName":"","sections":[{"type":"text","source":"My biggest gripe about Backbone.Marionette is that `Region`s require a wrapping element. Fortunately I've come up with a way to turn a Region's element into nothing but a placeholder so that it's removed when you use `Region.show()` to display a view. This will likely be in Marionette V3 but I don't want to wait that long so I've written this shim to implement the functionality today.\n\nFirst, we need to add a couple new methods to `Region`. `replaceEl()` will be called when we use `Region.show()` on an empty `Region` and `restoreEl()` will only be called when we use `Region.empty()` to make sure that we don't lose our `Region`'s position in the DOM."},{"type":"javascript","source":"Marionette.Region.prototype.replaceEl = function(view) {\n var parent;\n \n parent = this.el.parentNode;\n parent.replaceChild(view.el, this.el);\n this.replaced = true;\n};\n\nMarionette.Region.proto |
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
var _, getRoutes, getSchemas; | |
_ = require( 'lodash' ); | |
getSchemas = function ( mongoose ) { | |
var docs, models; | |
docs = {}; | |
models = mongoose.models; |
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
[ | |
{ | |
$project: { | |
successful: { | |
$cond: ['$successful', 1, 0] | |
} | |
}, | |
}, { | |
$group: { | |
_id: null, |
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
import Backbone from 'backbone' | |
import template from 'templates/BlogList.hbs' | |
export default class BlogList extends Backbone.Marionette.ItemView { |
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
#!/usr/bin/env python | |
import pprint | |
import sys | |
sys.path.append('../pgoapi') | |
from pgoapi import PGoApi | |
position = (43.060792, -89.410350, 0) |
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 * bodyBuilder (next) { | |
this.body = { | |
links: {}, | |
meta: { | |
start_ms: Date.now() | |
} | |
} | |
yield next |
OlderNewer