Skip to content

Instantly share code, notes, and snippets.

View lydemann's full-sized avatar

Christian Lüdemann lydemann

View GitHub Profile
@lydemann
lydemann / spy-helper.ts
Last active April 21, 2018 10:24
Provides helpers for easy and typesafe mocking with spies
/*
This class provides helpers for easy and typesafe mocking with spies
*/
// get keys of type
export declare function keys<T extends object>(): Array<keyof T>;
export class SpyHelper {
/*
export class GenericAction<ActionType, PayloadType> {
constructor(type: ActionType, payload?: PayloadType) {
this.type = type;
this.payload = payload;
}
type: ActionType;
payload?: PayloadType;
@lydemann
lydemann / tslint.json
Last active August 12, 2019 08:54
TSlint with Prettier
{
"extends": [
"tslint:recommended",
"tslint-eslint-rules",
"tslint-config-prettier",
"tslint-jasmine-rules"
],
"rulesDirectory": [
"node_modules/codelyzer"
],
@lydemann
lydemann / .prettierrc
Last active November 3, 2019 09:13
Prettier config
"prettier": {
"singleQuote": true,
"printWidth": 100,
"semi": true,
"bracketSpacing": true,
"arrowParens": "always"
}
@lydemann
lydemann / husky config
Created July 12, 2018 17:55
Husky precommit hooks with concurrently
"husky": {
"hooks": {
"pre-commit": "concurrently --kill-others \"npm run lint\" \"npm run test\" \"npm run build\"",
"pre-push": "git pull origin master"
}
}
@lydemann
lydemann / VS Code Settings
Created July 12, 2018 18:05
My preferred VS Code Settings
{
"gitlens.advanced.messages": {
"suppressFileNotUnderSourceControlWarning": true,
"suppressShowKeyBindingsNotice": true
},
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"workbench.editor.enablePreview": false,
"tslint.autoFixOnSave": true,
@lydemann
lydemann / VS Code Settings
Last active August 12, 2019 13:33
VS code settings for auto format, fix and organize imports.
{
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"tslint.autoFixOnSave": true
},
"editor.formatOnSave": true
}
@lydemann
lydemann / .huskyrc
Last active November 1, 2019 20:21
Husky Angular Config
{
"hooks": {
"commit-msg": "commitlint --config commitlint.config.js -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged",
"post-merge": "post-npm-install"
}
}
@lydemann
lydemann / index.html
Created July 28, 2018 09:39
HTML to show before Angular is loaded
<app-root>
<div class="container">
<div class="row">
<div id="loader">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
@lydemann
lydemann / spinner.scss
Created July 28, 2018 09:39
Spinner styling
#loader {
bottom: 0;
height: 175px;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
width: 175px;
}