Skip to content

Instantly share code, notes, and snippets.

View icfantv's full-sized avatar

Adam Gordon icfantv

View GitHub Profile
@icfantv
icfantv / twilight-zone.ts
Created March 24, 2017 22:31
The Twilight Zone
const events: any = {
'addEventListener:scroll': true,
'addEventListener:mouseenter': false,
'addEventListener:mouseleave' : false,
'addEventListener:mousemove': true,
};
// const twilightZone = Zone.current.fork(Zone['wtfZoneSpec']).fork({
const twilightZone = Zone.current.fork({
name: 'twilight',
{
"buildOnSave": false,
"compileOnSave": true,
"compilerOptions": {
"allowJs": false,
"baseUrl": "app/scripts/modules",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016",
import {NgModule, Type} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {UpgradeModule, downgradeInjectable} from '@angular/upgrade/static';
import {SPINNAKER_DOWNGRADES} from './modules';
declare let angular: any;
const providers: Type<any>[] = [];
SPINNAKER_DOWNGRADES.forEach((item) => {
providers.push(item.moduleClass);
@icfantv
icfantv / ExecutionWindowDayPickerController.html
Last active September 8, 2016 02:57
Days of the week component
<div class="btn-group">
<label class="btn btn-default" ng-model="dayPicker.dayModel.sunday" uib-btn-checkbox>Sun</label>
<label class="btn btn-default" ng-model="dayPicker.dayModel.monday" uib-btn-checkbox>Mon</label>
<label class="btn btn-default" ng-model="dayPicker.dayModel.tuesday" uib-btn-checkbox>Tue</label>
<label class="btn btn-default" ng-model="dayPicker.dayModel.wednesday" uib-btn-checkbox>Wed</label>
<label class="btn btn-default" ng-model="dayPicker.dayModel.thursday" uib-btn-checkbox>Thu</label>
<label class="btn btn-default" ng-model="dayPicker.dayModel.friday" uib-btn-checkbox>Fri</label>
<label class="btn btn-default" ng-model="dayPicker.dayModel.saturday" uib-btn-checkbox>Sat</label>
</div>
<div class="button-controls">
@icfantv
icfantv / karma.conf.js
Created September 1, 2016 01:33
ng2 rc.6 update
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
// For travis
'node_modules/core-js/client/shim.js',
@icfantv
icfantv / ExportListComponent.html
Created July 28, 2016 22:43
NG2 List/Component
<h1>Export Records</h1>
<div *ngIf="exports.length === 0">
This system has no export records created.
</div>
<div *ngIf="exports.length > 0">
<table class="table table-fixedheader export-grid">
<thead>
<tr>
<th *ngFor="let header of headers; let i = index" [ngClass]="columnWidths[i]">
<div class="no-select"
@icfantv
icfantv / karma-shim.js
Created July 19, 2016 04:59
Build Configuration
Error.stackTraceLimit = Infinity;
require('es6-shim');
require('reflect-metadata');
require('ts-helpers');
require('zone.js/dist/zone');
require('zone.js/dist/long-stack-trace-zone');
require('zone.js/dist/jasmine-patch');
@icfantv
icfantv / SisService.spec.ts
Created July 13, 2016 15:52
ng2 Service Test (RC4)
import {Injector, ReflectiveInjector} from '@angular/core';
import {HTTP_PROVIDERS, Response, ResponseOptions, XHRBackend} from '@angular/http';
import {MockBackend, MockConnection} from '@angular/http/testing';
import {ISisConsumer} from '../models';
import {TestSisConsumerGenerators} from '../test/TestSisConsumerGenerators';
import {SisService} from './SisService';
describe('test the sis consumer service', () => {
let injector: Injector;
from @amcdnl
import { Pipe } from 'angular2/core.js';
/**
* Map to Iteratble Pipe
*
* It accepts Objects and [Maps](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
*
* Example:
import {Injectable} from 'angular2/core';
import {Http} from 'angular2/http';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map';
const GITHUB_API_URL = 'https://api.github.com';
export class Repository {
name: string;
full_name: string;