(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Dealing with conflicts to db/structure.sql (when merging master) | |
$ git checkout master | |
# Change database.yml to point to database: clean (on localhost) in development env | |
# In one command: | |
# 1) drops the database specified in database.yml for current env ('clean' database) | |
# 2) creates a db with name specified in database.yml | |
# 3) loads master's structure into the database specified in database.yml |
git remote add upstream https://github.com/whoever/whatever.git
git fetch upstream
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}
FROM node:7 | |
COPY . /e2e | |
WORKDIR /e2e | |
RUN npm install | |
CMD npm test |
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.
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>; |
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'); |
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) |
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