Skip to content

Instantly share code, notes, and snippets.

View brandonroberts's full-sized avatar

Brandon Roberts brandonroberts

View GitHub Profile
@brandonroberts
brandonroberts / ivynext.md
Last active February 8, 2019 19:42
ivy next
yarn add @angular/{animations,common,compiler,core,forms,platform-browser,platform-browser-dynamic,router}@next
yarn add @angular/{compiler-cli,language-service,}@next --dev
yarn add @angular-devkit/build-angular@next --dev
yarn add @ngrx/{store,effects,entity,store-devtools,schematics}
@brandonroberts
brandonroberts / chromebook.sh
Last active November 27, 2019 02:50
Chromebook Scripts
# deps
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install nano git-core build-essential chromium
# git config
git config --global user.name "Brandon"
git config --global user.email "[email protected]"
# ssh
ssh-keygen -t rsa -b 4096 -C "[email protected]"
// In package.json:
"scripts": {
"e2e-watch": "concurrently --kill-others \"npm start\" \"npm run e2e-watch-no-serve\"",
"e2e-watch-no-serve": "watch \"npm run e2e -- --dev-server-target=\" src e2e --wait=1"
}
import { Store, Action, ofType } from '@ngrx/store';
import { catchError } from 'rxjs/operators';
import { of } from 'rxjs/observable/of';
import { switchMap, map } from 'rxjs/operators';
export class EffectError implements Action {
readonly type = '[Error] Effect Error';
}
@Injectable()
@brandonroberts
brandonroberts / introrx.md
Created January 11, 2018 18:12 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

Keybase proof

I hereby claim:

  • I am brandonroberts on github.
  • I am robertsbt (https://keybase.io/robertsbt) on keybase.
  • I have a public key whose fingerprint is 0F1E 5019 A8E3 E132 4664 9E4D A796 6078 A506 2002

To claim this, I am signing this object:

@brandonroberts
brandonroberts / collection-page.spec.ts
Last active March 2, 2017 17:11
Collection Page Test
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { Store, StoreModule } from '@ngrx/store';
import { By } from '@angular/platform-browser';
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
import * as fromRoot from '../reducers';
import * as collection from '../actions/collection';
import { ComponentsModule } from '../components';
import { CollectionPageComponent } from './collection-page';
@brandonroberts
brandonroberts / customer.component.ts
Last active May 30, 2020 12:20
Observables from blur events
import { Component, OnInit, AfterViewInit, ViewChildren, ElementRef } from '@angular/core';
import { FormGroup, FormBuilder, Validators, AbstractControl, FormControlName } from '@angular/forms';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/observable/fromEvent';
import 'rxjs/add/observable/merge';
import { Observable } from 'rxjs/Observable';
import { Customer } from './customer';
import { GenericValidator } from '../shared/generic-validator';
@brandonroberts
brandonroberts / routes.md
Last active August 23, 2016 20:38
@laurelnaid route tree

app.module.ts

@NgModule({
  imports: [
    RouterModule.forRoot([
      {
        path: 'routes/manage',
        loadChildren: './manage/manage.module#ManageModule'  
      }
@brandonroberts
brandonroberts / app.module.ts
Last active August 22, 2016 06:48
Route Modules
@NgModule({
imports: [
routing,
MainModule
]
})
export class MainModule {}