This is a method to store api keys locally in an api-keys.properties file, ignored by git, but still using them in JUnit tests, as they get loaded by gradle before tests and can be accessed then by the test class through System.getProperty().
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 { Component, Input } from '@angular/core'; | |
| import { trigger, style, animate, transition, keyframes } from '@angular/animations'; | |
| @Component({ | |
| selector: 'my-bar', // <my-app></my-app> | |
| template: ` | |
| <div class="containit"> | |
| <div class="lined-content" *ngIf="visible" [@shiftUpDown]="visible">line</div> | |
| </div> | |
| <div class="other">Some content below</div> |
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
| const fs = require('fs') | |
| const jsonFormat = require('json-format') | |
| class EmitOptionsWebpackPlugin { | |
| constructor(pluginOptions) { | |
| this.pluginOptions = { pretty: true, throwError: false, path: 'options.json', ...pluginOptions } | |
| } | |
| apply(compiler) { | |
| // create JSON from js object (will loose all functions such as Plugins) |
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
| export function mapGetSetters(object) { | |
| const resolved = {} | |
| const getters = {} | |
| const setters = [] | |
| Object.keys(object).forEach(key => { | |
| resolved[key] = {} | |
| const value = object[key] | |
| if (typeof value === 'string') { | |
| getters[key] = value |
- Activate sourceMaps if running with TypeScript
- Make sure Chrome/Chromium runs with debugging on Port 9222
=> Close Chrome and restart with the flag
--remote-debugging-port=9222 - If in
attach-mode, anurl, or better:urlFilteris required:"urlFilter": "http://localhost:4200/*" - Set the
webRootto yoursrcfolder:"webRoot": "${workspaceFolder}/src" - To fix the source map matching, add
sourceMapPathOverrides:
"sourceMapPathOverrides": {
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
| const emailRegex = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@([a-z0-9][a-z0-9-]*)*[a-z0-9]\.[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i; | |
| // SLD = second layer domain | |
| const emailWithSld = function (value, attrValue, vnode) { | |
| return emailRegex.test(value); | |
| }; | |
| export const customValidators = { | |
| emailWithSld | |
| }; |
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 { GraphQLObjectTypeConfig } from 'graphql' | |
| import { ThunkWithArgsCtx, GraphQLObjectType } from 'graphql/type/definition' | |
| interface OnlyJMGraphQLObjectTypeConfig<S, C> { | |
| alwaysFetch?: string | |
| sqlTable?: ThunkWithArgsCtx<string, any, C> | |
| uniqueKey?: string | string[] | |
| } | |
| /** MonkeyPatching GraphQLObjectType Constructor to give join monster access to config */ |
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
| blog:how-to-become-stronger-everyday,ts:2017-12-14 |
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
| let blacklists = ["http://localhost*","http://192.168.2.131/*","https://localhost*","https://pvmonitor.ml/*","https://stackblitz.com/*","https://*.stackblitz.io/*","https://emulatoronline.com/*"] | |
| let defaultengine = 'duckduckgo' |
npm install --save-dev --save-exact pretty-format@24.0.0- copy
DOMElementNoClassIdSnapshotSerializer.jsto your project folder - add
'./DOMElementNoClassIdSnapshotSerializer.js'tosnapshotSerializersin your jest config
Angular does create HTML for components like this:
<h1 class="ng-tns-c1-0">
app works! OlderNewer