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
"terminal.integrated.env.osx": { | |
"PATH": "./node_modules/.bin:${env:PATH}" | |
}, | |
"terminal.integrated.profiles.osx": { | |
"zsh": { | |
"path": "zsh", | |
"args": ["-i"] | |
} | |
}, |
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
// From https://stackblitz.com/edit/directive-collection-with-examples?file=src%2Fapp%2Fng-let.directive.ts | |
import { | |
Directive, | |
Input, | |
TemplateRef, | |
ViewContainerRef, | |
EmbeddedViewRef | |
} from "@angular/core"; | |
@Directive({ |
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
ZSH_THEME="agnoster" | |
plugins=(git nvm) | |
prompt_context() {} | |
prompt_dir() { | |
prompt_segment blue $CURRENT_FG '%1~' | |
} |
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
# Sync master with remote upstream (and re-checkout previous branch) | |
function gitsum { | |
currentBranch=$(git symbolic-ref -q --short HEAD) | |
git fetch upstream | |
git checkout master | |
git merge upstream/master | |
git push | |
git checkout $currentBranch | |
} |
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 { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; | |
class NgxLetContext { | |
ngxLet: any; | |
} | |
/* | |
* Example usage | |
* <ng-container *ngxLet="person$ | async as person"> | |
* <h1>{{person.name}}</h1> |
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
describe('doit', () => { | |
it('should build graph', () => { | |
const t = { | |
cart: ['saved'], | |
saved: ['items'], | |
items: [] | |
}; | |
const r = { | |
cart: 'cart', |
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 { ActivatedRouteSnapshot } from '@angular/router'; | |
export function getFullTreeParams(route: ActivatedRouteSnapshot, params = {}) { | |
if (route) { | |
params = {...params, ...route.params}; | |
} | |
return route.firstChild | |
? this.getFullTreeParams(route.firstChild, params) | |
: params; | |
} |
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 { ActivatedRoute } from '@angular/router'; | |
export function getFullTreeParams(route: ActivatedRoute, params = {}) { | |
if (route) { | |
params = {...params, ...route.snapshot.params}; | |
} | |
return route.parent | |
? this.getFullTreeParams(route.parent, params) | |
: params; | |
} |
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
// Add this one to an AppModule imports | |
import { BackendProviderModule } from '@myproject/backend-provider'; | |
// Use this one in the AppComponent for constructor injection | |
import { BackendService } from '@myproject/backend-provider'; |
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
// Only exported types will be able to be imported elsewhere | |
export { BackendProviderModule } from './src/backend-provider.module'; | |
export { BackendService } from './src/backend.service'; | |
// leave out the private stuff, like that Helpers class |
NewerOlder