Skip to content

Instantly share code, notes, and snippets.

View JeremyLikness's full-sized avatar

Jeremy Likness JeremyLikness

View GitHub Profile
it('shows feet and inches based on the value passed', () => {
expect(pipe.transform(70)).toEqual('5 ft. 10 in.');
});
it('should render title in a h1 tag', () => {
fixture.detectChanges();
let compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent)
.toContain('Redux Angular 2 Example with Kendo UI');
});
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'), // add the phantom launcher
require('karma-remap-istanbul'),
require('angular-cli/plugins/karma')
]
{
"name": "flowroute-cli",
"version": "0.0.1",
"description": "Simple command line interface for the Flowroute numbers API",
"main": "fr.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"flowroute"
(function (program, flowroute) {
var itemsPerPage = 10;
var formatNumber = function (raw) {
return `+${raw.substring(0, 1)} (${raw.substring(1,4)}) ${raw.substring(4,7)}-${raw.substring(7,11)}`;
}
var listNPAs = function (err, npaList) {
if (err) {
@JeremyLikness
JeremyLikness / index.js
Created April 7, 2017 18:45
Simple function service that takes an r value and returns 90 iterations of r * x * (1 - x)
module.exports = function (context, req) {
const badStatusMsg = "Please pass an r param on the query string with a value between 0 and 4";
const badStatus = msg => ({
status: 400,
body: msg
});
import { IterationsService } from './iterations.service';
...
providers: [IterationsService],
...
@JeremyLikness
JeremyLikness / iterations.service.ts
Created April 7, 2017 18:55
Service to consume Azure app function
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs/Rx';
import { Http, URLSearchParams } from '@angular/http';
export interface IBifurcation {
r: number;
x: number;
}
@Injectable()
@JeremyLikness
JeremyLikness / app.component.html
Created April 7, 2017 18:57
Template for bifurcation diagram
<h1>
{{title}}
</h1>
<canvas width="1000" height="500" #canvas></canvas>
@JeremyLikness
JeremyLikness / app.component.ts
Created April 7, 2017 18:58
Component to call bifurcation service
import { Component, ViewChild, ElementRef, OnInit } from '@angular/core';
import { IterationsService, IBifurcation } from './iterations.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {