Skip to content

Instantly share code, notes, and snippets.

View insanityrules's full-sized avatar

insanityrules

View GitHub Profile
@insanityrules
insanityrules / deployment.yml
Created February 25, 2018 19:19
deployment.yml file for deploying to kubernetes.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: hello-world-deployment
spec:
replicas: 2
template:
metadata:
labels: # labels to select/identify the deployment
app: hello-world
@insanityrules
insanityrules / eureka-js-client.d.ts
Created February 15, 2018 06:56
custom type definition for eureka-js-client
// Type definitions for eureka-js-client 4.3
// Project: https://github.com/jquatier/eureka-js-client
// Definitions by: Ilko Hoffmann <https://github.com/Schnillz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export class Eureka {
constructor(config: EurekaClient.EurekaConfig)
start(): void;
stop(): void;
getInstancesByAppId(appId: string): string[];
@insanityrules
insanityrules / rabbitMQ.ts
Created February 4, 2018 22:09
common file for using amqp protocol at gateway.
var amqp = require('amqplib');
var { EventEmitter } = require('events');
class RabbitMqConnection extends EventEmitter {
constructor(host, user, password, queues, prefetch) {
super();
this._url = `amqp://${user}:${password}@${host}`;
this._queues = queues || [ 'default' ];
this._prefetch = prefetch;