- Update npm:
npm install npm --global || npm i npm -g - New package:
npm init --yes || npm init -y - Scopes:
npm init --scope=myusernamenpm install @myusername/mypackagerequire('@myusername/mypackage') - Add dependencies:
npm install --save package-name || npm i -s package-name - Add devDependencies:
npm install --save-dev package-name || npm i -D package-name - Skip devDependencies:
npm install --production - Add bundled dependencies:
npm install --save --save-bundle package-name - Update dependencies:
npm outdated && npm update
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
| // Simulate a call to Dropbox or other service that can | |
| // return an image as an ArrayBuffer. | |
| var xhr = new XMLHttpRequest(); | |
| // Use JSFiddle logo as a sample image to avoid complicating | |
| // this example with cross-domain issues. | |
| xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true ); | |
| // Ask for the result as an ArrayBuffer. | |
| xhr.responseType = "arraybuffer"; |
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
| if (!process.env.NODE_PATH) { | |
| console.log(); | |
| if (process.env.SHELL === '/bin/zsh') { | |
| console.log(' Please set environment variable NODE_PATH in ~/.zshrc:'); | |
| } else if (process.env.SHELL === '/bin/bash') { | |
| console.log(' Please set environment variable NODE_PATH in ~/.bashrc:'); | |
| } else { | |
| console.log(' Please set environment variable NODE_PATH:'); | |
| } | |
| console.log(); |
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
| using System.Collections.Generic; | |
| using System.ComponentModel; | |
| using System.ComponentModel.DataAnnotations; | |
| using System.Web.Mvc; | |
| namespace Website.Models.EntityFrameworkCodeFirst | |
| { | |
| public class Entry | |
| { | |
| [Key] |
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
| /* Usage in Package Manager Console: | |
| Enable-Migrations | |
| Add-Migration "SetupMigrations" | |
| Update-Database | |
| -- change model | |
| Add-Migration "AddedPersonField" | |
| Update-Database | |
| Rollback to specific: | |
| Update-Database -TargetMigration:"SetupMigrations" |
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
| public class Coordinator | |
| { | |
| private readonly ICompleteUnitOfWork _unitOfWorkCompleter; | |
| private readonly WidgetGenerator _widgetGenerator; | |
| private readonly WotsitGenerator _wotsitGenerator; | |
| public Coordinator( | |
| ICompleteUnitOfWork unitOfWorkCompleter, | |
| WidgetGenerator widgetGenerator, | |
| WotsitGenerator wotsitGenerator) |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.DataAnnotations.Schema; | |
| using System.Data.Entity; | |
| using System.Data.Entity.ModelConfiguration; | |
| using System.Data.Entity.ModelConfiguration.Configuration; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using Brass9.Collections.HasProp; |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- | |
| This file contains all possible configuration options processed by Phalanger and PHP native extensions. | |
| The values stated here are the default ones. If you are creating a configuration for your application, | |
| state only those options which differ from the default values. | |
| Notes: | |
| Some option nodes can have specified a "scope" attribute. This is a string having one of the values |