(Full description and list of commands at - https://npmjs.org/doc/index.html)
##List of less common (however useful) NPM commands
######Prepand ./bin to your $PATH Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:
import { View } from 'backbone.marionette'; | |
import ScoreCounterView from './../../score_counter/view'; | |
import ScoreBehaviour from './../../../../../behaviors/score_helper'; | |
import Template from './template.hbs'; | |
import $ from 'jquery'; | |
export default View.extend({ | |
template: Template, |
fetchActivityFeedForRanking (options) { | |
let collection = options.views.feedItemsView.collection; | |
let data = {}; | |
let { ranking_id } = this; | |
if (ranking_id) { | |
data = { | |
ranking_id | |
}; | |
} |
const webpack = require('webpack'); | |
const ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
const path = require('path'); | |
module.exports = { | |
entry: './src/initialize.js', | |
assetsPublicPath: '', | |
output: { | |
path: __dirname + '/www/', | |
filename: 'bundle.js' |
➜ Doka git:(master) ✗ phonegap plugin add --save https://github.com/CreativeSDK/phonegap-plugin-csdk-image-editor | |
Fetching plugin "https://github.com/CreativeSDK/phonegap-plugin-csdk-image-editor" via git clone | |
Repository "https://github.com/CreativeSDK/phonegap-plugin-csdk-image-editor" checked out to git ref "master". | |
Installing "phonegap-plugin-csdk-image-editor" for browser | |
Fetching plugin "https://github.com/CreativeSDK/phonegap-plugin-csdk-client-auth" via git clone | |
Repository "https://github.com/CreativeSDK/phonegap-plugin-csdk-client-auth" checked out to git ref "master". |
(Full description and list of commands at - https://npmjs.org/doc/index.html)
##List of less common (however useful) NPM commands
######Prepand ./bin to your $PATH Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:
// Send errors to Google Analytics | |
window.onerror = (msg, file, line, column, error=null) => { | |
try { | |
if (error) msg = error.stack; | |
ga('send', 'event', 'error', '${file}:${line}', msg); | |
} catch (e) { | |
// Do nothing | |
} | |
} |
/** | |
* Pass in jQuery selector, for example: | |
* | |
* var elements = $('.my_element'); | |
* console.log(isElementInViewport(elements)) | |
*/ | |
function isElementInViewport(elements) { | |
var visibleElements = []; | |
elements.each(function () { |
App.module("App.$PARAM$", function ($PARAM$, App, Backbone, Marionette, $, _) { | |
'use_strict'; | |
$PARAM$.Controller = { | |
showHomepage: function () { | |
this.entities = this.getEntities(); | |
this.instantiateViews(); | |
this.setViewHandlers(); |
Single.ProductItemView = Marionette.CompositeView.extend({ | |
templateHelpers: function () { | |
return { | |
image: function () { | |
var image = this.model.getPreviewImage(); | |
if (image) { | |
return image.get('large_url'); | |
} | |
return ""; | |
} |
function being_indexed() { | |
var userAgent = navigator.userAgent, | |
isPresent = userAgent.search('Prerender'); | |
return isPresent !== -1; | |
} |