(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/:
| $.fn.serializeObject = function () { | |
| var o = {}; | |
| var serialized = {}; | |
| $("[name]", this).each(function () { | |
| var name = $(this).attr('name'); | |
| var value = $(this).val(); | |
| var nameBits = name.split('['); | |
| var previousRef = serialized; | |
| for (var i = 0, l = nameBits.length; i < l; i++) { |
| Modify your Gemfile.lock, set the following Gems to corresponding versions: | |
| colorize 0.7.4 | |
| sshkit 1.5.1 |
| function being_indexed() { | |
| var userAgent = navigator.userAgent, | |
| isPresent = userAgent.search('Prerender'); | |
| return isPresent !== -1; | |
| } |
| Single.ProductItemView = Marionette.CompositeView.extend({ | |
| templateHelpers: function () { | |
| return { | |
| image: function () { | |
| var image = this.model.getPreviewImage(); | |
| if (image) { | |
| return image.get('large_url'); | |
| } | |
| return ""; | |
| } |
| App.module("App.$PARAM$", function ($PARAM$, App, Backbone, Marionette, $, _) { | |
| 'use_strict'; | |
| $PARAM$.Controller = { | |
| showHomepage: function () { | |
| this.entities = this.getEntities(); | |
| this.instantiateViews(); | |
| this.setViewHandlers(); |
| /** | |
| * Pass in jQuery selector, for example: | |
| * | |
| * var elements = $('.my_element'); | |
| * console.log(isElementInViewport(elements)) | |
| */ | |
| function isElementInViewport(elements) { | |
| var visibleElements = []; | |
| elements.each(function () { |
| // 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 | |
| } | |
| } |
(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/:
| ➜ 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". |
| 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' |