This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import types | |
# if passed as 1st argument to decorator will be used for setup and teardown | |
from typing import Optional, Generator, Dict, Callable, Union | |
# first call by next will setup. 2nd call will teardown. | |
def setup(): | |
print("setup") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, ModuleWithProviders, NgModule, Optional } from '@angular/core'; | |
import { | |
HTTP_INTERCEPTORS, | |
HttpEvent, | |
HttpHandler, | |
HttpInterceptor, | |
HttpRequest | |
} from '@angular/common/http'; | |
import { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Vector { | |
constructor(public x: number, | |
public y: number, | |
public z: number) { | |
} | |
static times(k: number, v: Vector) { return new Vector(k * v.x, k * v.y, k * v.z); } | |
static minus(v1: Vector, v2: Vector) { return new Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); } | |
static plus(v1: Vector, v2: Vector) { return new Vector(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); } | |
static dot(v1: Vector, v2: Vector) { return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM webdevops/php-apache-dev:7.2 | |
# add microsoft packages to apt sources | |
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list | |
# install needed system packages as well as a few nice to have utils | |
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get -y upgrade && \ | |
ACCEPT_EULA=Y apt-get -y install msodbcsql17 unixodbc-dev less joe iputils-ping traceroute telnet && \ | |
apt-get purge -y --auto-remove && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SessionObj ensures that reload,save and destroy are functions, any other key is fair game | |
export interface SessionObj { | |
reload: () => Promise<any>, | |
save: () => Promise<any>, | |
destroy: () => Promise<any>, | |
[key: string]: any | |
} | |
// add our session member to SocketIO.Socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### your registry must have the following environment var set | |
# REGISTRY_STORAGE_DELETE_ENABLED=true | |
### replace YOUR_SERVER with corect info | |
REGISTRY_URL=https://YOUR_SERVER:5000 | |
### host registry volume folder | |
REGISTRY_ROOT=/registry | |
### container to execute garbage-collect | |
CONTAINER_NAME=services_registry.1 |
NewerOlder