Skip to content

Instantly share code, notes, and snippets.

View brandonroberts's full-sized avatar

Brandon Roberts brandonroberts

View GitHub Profile
@brandonroberts
brandonroberts / schematic.ts
Last active July 11, 2019 19:59
Schematic vs find/replace
import { Rule, Tree } from '@angular-devkit/schematics';
import * as ts from 'typescript';
import { toPropertyName, toClassName } from '@nrwl/workspace';
import { RequestContext } from './request-context';
import { createOrUpdate, replaceNodeValue, findNodes, } from '@nrwl/workspace/src/utils/ast-utils';
import { getDecoratorPropertyValueNode } from '../../../utils/ast-utils';
export function updateReducerKey(context: RequestContext): Rule {
return (host: Tree) => {
const modulePath = context.options.module;
@brandonroberts
brandonroberts / .bash_aliases
Last active November 28, 2019 02:47
Git Aliases
alias gch='git checkout'
alias gcb='git checkout -b'
alias gcm='git checkout master'
alias greb='git rebase'
alias grbm='git rebase master'
alias grbc='git rebase --continue'
alias gpl='git pull --ff'
alias gbr='git branch'
alias gpo='git push origin'
alias gdff='git diff'

Code of Conduct Project Action Items

How to: Show conference how to abide by CoC by displaying on website

  • Create (TJ)
    • CoC should be visibly displayed on participants’ website (TJ)
    • Reference to where CoC can be found and where to find the confidential incident report should be printed (TJ)
    • Confidential incident report should be made accessible to attendees/ participants (TJ)

How Men Can Become Better Allies To Women

@Component({
selector: 'app-movies-page',
template: `
<h1>Movies Page</h1>
`
})
export class MoviesPageComponent implements OnInit {
constructor(private store: Store<fromRoot.State>) {}
@Component({
selector: 'app-movies-page',
template: `
<h1>Movies Page</h1>
<div *ngIf="error$ | async as errorMessage">
{{ errorMessage }}
</div>
`
})
export const selectMoviesPageError = createSelector(
selectMoviesState,
state => state.error // return error message
)
export interface State {
items: Movie[];
error: string | null; // track errors
}
export const initialState = {
items: [],
error: null // default error value
}
@Component({
selector: 'app-movies-page',
template: `
<h1>Movies Page</h1>
<div *ngIf="error$ | async as errorMessage">
{{ errorMessage }}
</div>
`
})
@Component({
selector: 'app-movies-page',
template: `
<h1>Movies Page</h1>
<div *ngIf="error">
{{ error }}
</div>
`
})
@brandonroberts
brandonroberts / movies-page.component.1.ts
Last active March 4, 2019 23:36
Handling Error States with NgRx
@Component({
selector: 'app-movies-page',
template: `
<h1>Movies Page</h1>
<div *ngIf="error">
{{ error }}
</div>
`
})