Skip to content

Instantly share code, notes, and snippets.

View andrewconnell's full-sized avatar
馃摵
Building courses for @Voitanos

Andrew Connell andrewconnell

馃摵
Building courses for @Voitanos
View GitHub Profile

Keybase proof

I hereby claim:

  • I am andrewconnell on github.
  • I am andrewconnell (https://keybase.io/andrewconnell) on keybase.
  • I have a public key ASAlriAsYajy03CnnWK6uHxrsJ0Ly246_UxCvDV2OqE2hQo

To claim this, I am signing this object:

@andrewconnell
andrewconnell / client.ts
Created September 11, 2016 11:09
Creating client to talk to the gRPC server RateKeeper
import * as path from 'path';
let grpc: any = require('grpc');
import {
IPublicCloudMeter, IProtobufTimestamp, IRateKeeperClient, IRateKeeperGetMeterResponse
} from 'voyager-shared';
class RateKeeperClient {
public static createGrpcClient(host: string, port: number): IRateKeeperClient {
let protoPath: string = path.join('[relative-path-to]/ratekeeper.proto');
@andrewconnell
andrewconnell / server.ts
Created September 11, 2016 11:08
RateKeeper created & started
import { RateKeeperServer } from './RateKeeperServer';
let grpcServer: RateKeeperServer = new RateKeeperServer();
grpcServer.start();
@andrewconnell
andrewconnell / RateKeeperService.ts
Last active September 11, 2016 11:05
TypeScript representation of the RateKeeper protobuf & gRPC client
import { IPublicCloudMeter, IPublicCloudMeterPrice } from './';
export interface IRateKeeperServer {
addMeter: (call: IRateKeeperAddMeterCall, callback: RateKeeperAddMeterCallback) => void;
getMeter: (call: IRateKeeperGetMeterCall, callback: RateKeeperGetMeterCallback) => void;
}
export interface IRateKeeperClient {
addMeter(request: IRateKeeperAddMeterRequest, callback: RateKeeperAddMeterCallback): void;
@andrewconnell
andrewconnell / ratekeeper.proto
Created September 11, 2016 11:03
RateKeeper Protobuf definition file
syntax = "proto3";
package ratekeeper;
service RateKeeperService {
rpc GetMeter(GetMeterRequest) returns (GetMeterResponse) {}
rpc AddMeter(AddMeterRequest) returns (AddMeterResponse) {}
}
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
FROM node:5.11.1
RUN mkdir -p /home/nodejs && \
groupadd -r nodejs && \
useradd -r -g nodejs -d /home/nodejs -s /sbin/nologin nodejs && \
chown -R nodejs:nodejs /home/nodejs && \
mkdir -p /voyager/app && \
chown -R nodejs:nodejs /voyager/app && \
npm install -g nodemon
@andrewconnell
andrewconnell / gulpPlugins.ts
Created August 10, 2016 17:20
Gulp Plugins barrel
let gulpConvChangeLog: any = require('gulp-conventional-changelog');
import * as gulpPlumber from 'gulp-plumber';
let gulpPrint: any = require('gulp-print');
import * as gulpIf from 'gulp-if';
import * as gulpIstanbul from 'gulp-istanbul';
import * as gulpMocha from 'gulp-mocha';
let gulpRimraf: any = require('gulp-rimraf');
import * as gulpTslint from 'gulp-tslint';
import * as gulpTypeScript from 'gulp-typescript';
import * as gulpSourcemaps from 'gulp-sourcemaps';
@andrewconnell
andrewconnell / build.ts
Created August 10, 2016 17:09
Gulp Task for Building Project & Application TypeScript Code
import * as gulp from 'gulp';
import * as yargs from 'yargs';
import * as merge from 'merge2';
import { BaseGulpTask } from '../BaseGulpTask';
import { BuildConfig, ProjectArtifact, ProjectPaths, Utils } from '../buildBarrel';
import { gulpIf, gulpPlumber, gulpPrint, gulpSourcemaps, gulpTypeScript } from '../gulpPlugins';
/**
* Builds the project, then the application.
*

NOTE: since originally posting this, I have setup appveyor and dramatically simplfiied our process. for backreference, i branched the repo with the old scripted setup here: https://github.com/ngOfficeUIFabric/nuget-ngofficeuifabric/tree/scripted-deploy. Links below have been updated to point to that branch. master now contains the appveyor build out

full repo: https://github.com/ngOfficeUIFabric/nuget-ngofficeuifabric

goal of this library is to hold contents for a NuGet package, then using CI (travisci / circleci) have it run two gulp tasks to create the nuget package & submit via HTTP PUT to NuGet.org, updating this nuget package: https://www.nuget.org/packages/ng-office-ui-fabric/

external dependencies:

@andrewconnell
andrewconnell / build-ts.ts
Last active October 31, 2015 13:27
Example gulp task... this compiles all TypeScript to JavaScript in a project
'use strict';
import {BaseGulpTask} from '../BaseGulpTask';
import * as gulp from 'gulp';
import {Utils} from '../utils';
import * as yargs from 'yargs';
let $: any = require('gulp-load-plugins')({ lazy: true });
/**
* Builds all TypeScript as JavaScript as the gulp task 'build-ts'.