Skip to content

Instantly share code, notes, and snippets.

View Markus-Ende's full-sized avatar
🤓
Always learning

Markus Ende Markus-Ende

🤓
Always learning
View GitHub Profile
@Markus-Ende
Markus-Ende / example-typeorm-jest.test.ts
Created July 8, 2021 06:17 — forked from Ciantic/example-typeorm-jest.test.ts
Example of testing TypeOrm with Jest and Sqlite in-memory database
import { createConnection, getConnection, Entity, getRepository } from "typeorm";
import { PrimaryGeneratedColumn, Column } from "typeorm";
@Entity()
export class MyEntity {
@PrimaryGeneratedColumn()
id?: number;
@Column()
name?: string;
@Markus-Ende
Markus-Ende / in-memory-http-server.cs
Created September 25, 2019 14:30 — forked from yetanotherchris/in-memory-http-server.cs
In memory http server for C# unit and integration tests
public static Task BasicHttpServer(string url, string outputHtml)
{
return Task.Run(() =>
{
HttpListener listener = new HttpListener();
listener.Prefixes.Add(url);
listener.Start();
// GetContext method blocks while waiting for a request.
HttpListenerContext context = listener.GetContext();
@Markus-Ende
Markus-Ende / tmux.md
Created October 17, 2018 09:08 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@Markus-Ende
Markus-Ende / ts-mockito-simple-example-1.ts
Last active August 31, 2018 09:28
Caution, used in Medium article!
const mockService: MyService = mock(MyService);
when(mockService.someFunction()).thenReturn('some value');
const mockServiceInstance: MyService = instance(mockService);
@Markus-Ende
Markus-Ende / 1_mock-provider.ts
Last active November 22, 2020 15:51
Mocking Angular Providers with ts-mockito
const mockProvider = <T>(
toMock: Type<T>,
setupMock: (m: T) => void
): {
provide: Type<T>;
useFactory: () => T;
} => {
const m = mock(toMock);
setupMock(m);
return { provide: toMock, useFactory: () => instance(m) };
@Markus-Ende
Markus-Ende / CmderZSH.md
Last active June 23, 2018 05:26 — forked from dfontana/CmderZSH.md
My setup guide for installing Cgywin, Mintty, Cmder, and ZSH.

What's this?

Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.

The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.

Why is this here?

For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.

What exactly is covered?

  • Installing and setting up cmder
@Markus-Ende
Markus-Ende / gist:01f56a007ec9f4eca5f8aa19300643bd
Created March 5, 2018 09:04
Setup Karma in LXSS to use Windows Chrome installation
# In karma conf
customLaunchers: {
Chrome_from_lxss: {
base: 'Chrome',
chromeDataDir: 'C:\\Temp\\karma-' + Date.now()
}
}
# In .zshrc
@Markus-Ende
Markus-Ende / Useful-Visual-Studio-Code-extensions.md
Last active June 3, 2017 08:30
Useful Visual Studio Code extensions

Useful Visual Studio Code extensions

gitignore

Language support for .gitignore

gi

create .gitignore file and add configurations from templates

Kraut Ipsum Filler Text

Traditional german filler text :-)

@Markus-Ende
Markus-Ende / .bash_profile
Created March 19, 2017 09:38
Auto-add ssh keys to ssh-agent (.bash_profile)
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}