Skip to content

Instantly share code, notes, and snippets.

angular.injector

Creates an injector object that can be used for retrieving services as well as for dependency injection

  // create an injector
  var $injector = angular.injector(['ng']);
  // use the injector to kick off your application
  // use the type inference to auto inject arguments, or use implicit injection
 $injector.invoke(function($rootScope, $compile, $document){
@eriktrom
eriktrom / application.controller.js
Last active September 17, 2015 08:42
sendAction problem
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
nextVideo() {
console.log('w00t');
}
}
@eriktrom
eriktrom / index.js
Created December 16, 2015 19:05
ember-fastboot-render
import Promise from 'bluebird';
import SimpleDOM from 'simple-dom';
import Wreck from 'wreck';
import Redis from 'redis';
import Contextify from 'contextify';
Promise.promisifyAll(Wreck);
Promise.promisifyAll(Redis.RedisClient.prototype);
export default {
@eriktrom
eriktrom / port-finder-test.js
Created February 12, 2016 14:45
portfinder test for localhost
/*
* portfinder-test.js: Tests for the `portfinder` module.
*
* (C) 2011, Charlie Robbins
*
*/
var vows = require('vows'),
assert = require('assert'),
portfinder = require('../lib/portfinder'),
@eriktrom
eriktrom / portfinder-console-log-output.txt
Created March 16, 2016 18:30
Port Finder Test Console Logged Output
npm test
> [email protected] test /Users/trom/Documents/desktop_space/Dropbox/dev/dev-oss/node-portfinder
> vows test/*-test.js --spec
♢ portfinder
in everyLimit() iteration callback: host is ::1
entered testPort(): trying ::1 port 32768
@eriktrom
eriktrom / gist:47074112bc79c804c8f2
Created March 16, 2016 19:11
port finder log test 2 (final)
♢ portfinder
in eachSeries() iteration callback: host is ::1
entered testPort(): trying ::1 port 32768
done w/ testPort(): OK ::1 port 32768
in eachSeries() iteration callback testPort() callback with a success for port 32768
in eachSeries() iteration callback: host is 127.0.0.1
entered testPort(): trying 127.0.0.1 port 32768
done w/ testPort(): OK 127.0.0.1 port 32768
in eachSeries() iteration callback testPort() callback with a success for port 32768
@eriktrom
eriktrom / interfaces.json
Created July 17, 2016 21:45
os.networkInterfaces() on osx el-capitan (10.11.1 (15B42))
{ lo0:
[ { address: '::1',
netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
family: 'IPv6',
mac: '00:00:00:00:00:00',
scopeid: 0,
internal: true },
{ address: '127.0.0.1',
netmask: '255.0.0.0',
family: 'IPv4',
@eriktrom
eriktrom / snippet.txt
Created August 16, 2016 03:36
debug npm test for portfinder branch: catch-eaddrnotavail - mac os
npm test
> [email protected] test /Users/trom/Documents/desktop_space/Dropbox/dev/dev-oss/node-portfinder
> vows test/*-test.js --spec
(node:23360) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
default hosts are %o [ '::1',
'127.0.0.1',
'fe80::1',
'fe80::a299:9bff:fe17:766d',
@eriktrom
eriktrom / ember-cli-on-bash.md
Created October 20, 2016 23:34
windows-10-bash-ember-cli

Context:

VM: 3 gigs of ram, Parallels Desktop Windows: Bash shell:

  • From cmd.exe I run bash which logs me in as root. Then I run su - user to use the user user, which was installed by default and has a /home/user directory. I could have made a new user with a home directory, add them to the sudo group, but I just used the quickest route possible to test this out.

Errors when running ember new

@eriktrom
eriktrom / npm-test.txt
Created May 2, 2017 20:17
debug-portfinder
DEBUG=* npm test
> [email protected] test /Users/trom/Documents/desktop_space/Dropbox/dev/dev-oss/node-portfinder
> vows test/*-test.js --spec
portfinder:defaultHosts exports._defaultHosts is: [ '127.0.0.1', '::1', 'fe80::1', 'fe80::8c3:5090:6f70:ebcd', '10.0.1.22', 'fe80::fc77:49ff:fe37:c7e5', '10.211.55.2', '10.37.129.2', 'fe80::4c67:fb4:a09c:efff' ] +0ms
♢ portfinder
When using portfinder module with 5 existing servers the getPort() method