We use git-secret to encrypt/decrypt sensitive information like production passwords.
Each developper needs to generate a pair of private/public key.
https://help.github.com/articles/generating-a-new-gpg-key/
gpg --full-generate-key
import { Injectable, Inject } from '@angular/core'; | |
import { ReplaySubject, Observable } from 'rxjs'; | |
import { DOCUMENT } from '@angular/common'; | |
@Injectable() | |
export class LazyLoadingScriptService { | |
_loadedLibraries: { [url: string]: ReplaySubject<any> } = {}; | |
constructor(@Inject(DOCUMENT) private readonly document: any) { } |
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: dns-sync | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: S | |
# Default-Stop: | |
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks | |
### END INIT INFO |
We use git-secret to encrypt/decrypt sensitive information like production passwords.
Each developper needs to generate a pair of private/public key.
https://help.github.com/articles/generating-a-new-gpg-key/
gpg --full-generate-key
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(` | |
[Security.Principal.WindowsBuiltInRole] "Administrator")) | |
{ | |
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!" | |
Break | |
} | |
Write-Host "Excluding appdata NPM folder and Node.JS install folder from Windows Defender." | |
Add-MpPreference -ExclusionPath ([System.Environment]::ExpandEnvironmentVariables("%APPDATA%\npm\")) | |
Add-MpPreference -ExclusionPath (Get-ItemProperty "HKLM:SOFTWARE\Node.js" | Select-Object -Property InstallPath) |
import { MovieShowingsComponent } from './movie-showings.component'; | |
import { cold, getTestScheduler } from 'jasmine-marbles'; | |
describe('MovieShowingsComponent', () => { | |
it('should not have a race condition', () => { | |
const backend = jasmine.createSpyObj('backend', ['getShowings']); | |
const cmp = new MovieShowingsComponent(backend); | |
backend.getShowings.and.returnValue(cold('--x|', {x: ['10am']})); | |
cmp.selectMovie('After the Storm'); |
import { Action, ActionReducer, Store } from '@ngrx/store'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
import { Observable } from 'rxjs/Observable'; | |
import { map } from 'rxjs/operator/map'; | |
import { Observer } from 'rxjs/Observer'; | |
// TODO: How to initialize those variables? | |
const dispatcherMock: Observer<Action>, | |
reducerMock: Observer<ActionReducer<any>>, | |
stateMock: Observable<any>; |
I'm loving Angular, but running unit tests on Karma gets my nerves. It's too slow for me.
In this post, I explain mechanics under Angular's testing module and how to improve the performance.
To evaluate Angular unit testing performance I captured the CPU profiling with running Karma.
FROM node:7 | |
COPY . /e2e | |
WORKDIR /e2e | |
RUN npm install | |
CMD npm test |
Plain JavaScript objects are better than classes when they can be used, and many popular modern frameworks have adopted their use.
Consider that in React a component can be created as either a class or as an object.
// using a class
class Welcome extends React.Component {
render() {
Hello, {this.props.name}
git remote add upstream https://github.com/whoever/whatever.git
git fetch upstream