(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 * as typeorm from 'typeorm'; | |
| import { AlreadyHasActiveConnectionError } from 'typeorm/error/AlreadyHasActiveConnectionError'; | |
| import { Driver } from 'typeorm/driver/Driver'; | |
| import { DriverFactory } from 'typeorm/driver/DriverFactory'; | |
| import { PostgresDriver } from 'typeorm/driver/postgres/PostgresDriver'; | |
| import { stub } from 'sinon'; | |
| // Load all of my entities from the index | |
| import * as entities from './../../src/entity' |
| [Container] 2018/10/05 16:39:06 Waiting for agent ping | |
| [Container] 2018/10/05 16:39:06 Waiting for DOWNLOAD_SOURCE | |
| [Container] 2018/10/05 16:39:14 Phase is DOWNLOAD_SOURCE | |
| [Container] 2018/10/05 16:39:14 CODEBUILD_SRC_DIR=/codebuild/output/src423135217/src/github.com/ScoutGroup/fdc_backend | |
| [Container] 2018/10/05 16:39:14 YAML location is /codebuild/output/src423135217/src/github.com/ScoutGroup/fdc_backend/buildspec.yml | |
| [Container] 2018/10/05 16:39:14 Processing environment variables | |
| [Container] 2018/10/05 16:39:14 Moving to directory /codebuild/output/src423135217/src/github.com/ScoutGroup/fdc_backend | |
| [Container] 2018/10/05 16:39:14 Registering with agent | |
| [Container] 2018/10/05 16:39:14 Phases found in YAML: 3 | |
| [Container] 2018/10/05 16:39:14 BUILD: 3 commands |
| // Items we'd like to have mixed into our class | |
| const { EventEmitter } = require('events'); | |
| const { Writable } = require('stream'); | |
| // ... moar | |
| // Create the mixin mixer, we'll extend this. always. | |
| const Mixin = (...args) => { | |
| // Parent class, this constant needs to return a constructor | |
| // so we'll have the constructor map all of our classes into it | |
| return class Mixin { |
(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/:
| var async = require('async'); | |
| module.exports = waitFor; | |
| /** | |
| * waitFor port used with | |
| * @see {@link https://github.com/ariya/phantomjs/blob/master/examples/waitfor.js} | |
| * @see {@link https://github.com/sgentle/phantomjs-node} | |
| * @callback testFx - Test function, will repeat until true or timeout limit is reached | |
| * @callback onReady - Fires if/when `testFx` passes. |
| // Usage | |
| var err = new Error('Hey th\'upid, you didn\'t Catch your shenanigans!'); | |
| console.log(err.toJSON()); | |
| // If run in the chrome console | |
| // this is exceptionally usefully if debuggong locally, but stacks aren't so great in production | |
| return { | |
| stack: "Error: Hey th'upid, you didn't Catch your shenanigans! <anonymous>:2:13 at Object.InjectedScript._evaluateOn (<anonymous>:895:140) at Object.InjectedScript._evaluateAndWrap (<anonymous>:828:34)at Object.InjectedScript.evaluate (<anonymous>:694:21)", | |
| message: "Hey th'upid, you didn't Catch your shenanigans!" | |
| } |
| /** | |
| * usage: `<button print="#elementId">Print Me Foo!</button>` | |
| **/ | |
| angular.module('ngApp', []).directive('print', function ($location, $timeout) { | |
| return { | |
| restrict: 'A', | |
| link: function(scope, element, attrs) { |
| Host [server 2] | |
| ProxyCommand ssh [server1] exec nc %h %p | |
| User [username] |
| # Vagrant Cheats | |
| # =========================== | |
| alias vup="vagrant up" | |
| alias vh="vagrant halt" | |
| alias vs="vagrant suspend" | |
| alias vr="vagrant resume" | |
| alias vrld="vagrant reload" | |
| alias vssh="vagrant ssh" | |
| alias vstat="vagrant status" |
| # Git Cheats | |
| # =========================== | |
| alias gs="git status" | |
| alias gl="git log --stat" | |
| alias gap="git add -p" | |
| alias gd="git diff" | |
| alias gs="git status" | |
| alias gp="git push" |