As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
configdocs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public - Sep 07, 2020 update docs for
npm version
| /*! | |
| * isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill | |
| * Copyright (c) 2011 Addy Osmani | |
| * Dual licensed under the MIT and GPL licenses. | |
| */ | |
| (function () { | |
| window.visibly = { | |
| b: null, | |
| q: document, |
| // NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
| { | |
| // Settings | |
| "passfail" : false, // Stop on first error. | |
| "maxerr" : 100, // Maximum error before stopping. | |
| // Predefined globals whom JSHint will ignore. | |
| "browser" : true, // Standard browser globals e.g. `window`, `document`. |
| /* | |
| * Extends Handlebars with a basic get method for loading external | |
| * Handlebars templates. Simply pass an options object which contains | |
| * the following properties: | |
| * - path (required) : Path to the external template file to be loaded | |
| * - success (required) : Callback invoked with the compiled loaded template. | |
| * - cache (optional) : true if the template is to be cached, otherwise false. | |
| * | |
| * In addition to the above arguments, any jQuery/Zepto.ajax options argument | |
| * can be specified as well. |
| // Media Queries in Sass 3.2 | |
| // | |
| // These mixins make media queries a breeze with Sass. | |
| // The media queries from mobile up until desktop all | |
| // trigger at different points along the way | |
| // | |
| // And important point to remember is that and width | |
| // over the portrait width is considered to be part of the | |
| // landscape width. This allows us to capture widths of devices | |
| // that might not fit the dimensions exactly. This means the break |
| app.use(express.methodOverride()); | |
| // ## CORS middleware | |
| // | |
| // see: http://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs | |
| var allowCrossDomain = function(req, res, next) { | |
| res.header('Access-Control-Allow-Origin', '*'); | |
| res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
| res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization'); | |
| { | |
| // -------------------------------------------------------------------- | |
| // JSHint Configuration, Strict Edition | |
| // -------------------------------------------------------------------- | |
| // | |
| // This is a options template for [JSHint][1], using [JSHint example][2] | |
| // and [Ory Band's example][3] as basis and setting config values to | |
| // be most strict: | |
| // | |
| // * set all enforcing options to true |
| var util = require('util'), | |
| EventEmitter = require('events').EventEmitter; | |
| var Server = function() { | |
| var self = this; | |
| this.on('custom_event', function() { | |
| self.logSomething('custom_event'); | |
| }); |
| -server | |
| -Xms512m | |
| -Xmx2048m | |
| -XX:MaxPermSize=512m | |
| -XX:ReservedCodeCacheSize=256m | |
| -XX:+UseCodeCacheFlushing | |
| -XX:+UseCompressedOops | |
| -XX:+UseConcMarkSweepGC | |
| -XX:+AggressiveOpts | |
| -XX:+CMSClassUnloadingEnabled |
| var spawn = require("child_process").spawn; | |
| var Q = require("q"); | |
| /** | |
| * Wrap executing a command in a promise | |
| * @param {string} command command to execute | |
| * @param {Array<string>} args Arguments to the command. | |
| * @param {string} cwd The working directory to run the command in. | |
| * @return {Promise} A promise for the completion of the command. | |
| */ |