Skip to content

Instantly share code, notes, and snippets.

View GregOnNet's full-sized avatar
🎸
Rock On & Code

Gregor Woiwode GregOnNet

🎸
Rock On & Code
View GitHub Profile
@GregOnNet
GregOnNet / mongodb-testing.module.ts
Created January 14, 2022 07:08
Starts and Stops mongo-memory-db
import { ConfigService } from '@leocloud/shared';
import { DynamicModule, Inject, Module, OnApplicationBootstrap, OnApplicationShutdown } from '@nestjs/common';
import { MongoMemoryServer } from 'mongodb-memory-server';
import { connect, disconnect } from 'mongoose';
import { Subject } from 'rxjs';
const MONGO_DB_TESTING_COLLECTION_NAMES = 'MongoDbTestingCollectionNames';
const mongoDbIsBootstrapped = new Subject<void>();
@GregOnNet
GregOnNet / comp.vue
Last active January 22, 2021 16:38
comp
<template>
<div>
<p v-if="success" data-test="book-form--success">
Successfully created new book.
</p>
<form novalidate @submit.prevent="submit">
<p>
<label for="title">Title</label>
<input
type="text"
@GregOnNet
GregOnNet / component-object.ts
Created July 18, 2019 15:34
Component Object simplifying testing for Angular Components
import { ComponentFixture } from '@angular/core/testing';
import { Predicate, DebugElement } from '@angular/core';
import { ValueSetter } from '../company-create/company-create.component.spec.co';
export class ComponentObject<T> {
constructor(private fixture: ComponentFixture<T>) {}
get componentInstance(): T {
return this.fixture.componentInstance;
}
@GregOnNet
GregOnNet / git-aliases.sh
Created February 3, 2019 20:55
Git | Basic Aliases
# Staging
alias s="git status"
alias a="git add"
alias aa="git add --all"
# Commit
alias cim="git commit --message"
alias cima="git commit --all --message"
alias aac="git add --all && git commit --all --message"
@GregOnNet
GregOnNet / cloudSettings
Last active February 10, 2020 09:19
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-02-10T09:19:05.383Z","extensionVersion":"v3.4.3"}
@GregOnNet
GregOnNet / tsconfig.app.json
Created February 1, 2018 06:47
using typescript paths in @angular/cli projects
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@utilities/*": ["./app/utilities/*"]
},
"outDir": "../out-tsc/app",
"module": "es2015",
"types": []
@GregOnNet
GregOnNet / loadtest.d.ts
Created February 13, 2017 08:41
Typings for loadtest
declare namespace loadtest {
export function loadTest(options: LoadTestOptions, err: Function): void;
export interface LoadTestOptions {
url: string;
concurrency?: number;
maxRequests?: number;
maxSeconds?: number;
timeOut?: number;
cookies?: string[];
@GregOnNet
GregOnNet / pull-request.sh
Created February 16, 2016 08:52
Fetches commits of a pull request
git fetch origin pull/1/head:<target-branch>
@GregOnNet
GregOnNet / FreeStockCharts-full-width.css
Created January 17, 2016 16:37
Nutzt rechte Spalte der Werbebanner für die Charts
/* In Stylish einfügen */
#SilverlightControl1 {
width: 100% !important;
}
public override void OnBeginRequest(HttpContextBase context, IWindsorContainer container)
{
var parameters = new Arguments(new
{
response = context.Response,
pdfFormatter = container.Resolve<IFormatPdfResponse>()
});
container.Resolve
<IDispatchPdfReponses>(parameters)