Skip to content

Instantly share code, notes, and snippets.

View flashjpr's full-sized avatar
🎯
Focusing

Alex flashjpr

🎯
Focusing
View GitHub Profile
@flashjpr
flashjpr / conditional_effects.ts
Created May 21, 2019 20:42 — forked from vespertilian/conditional_effects.ts
Two options for conditional ngrx effects
@Effect()
selectAndLoadStore$: Observable<Action> = this.actions$
.ofType(storeActions.SELECT_AND_LOAD_STORE)
.withLatestFrom(this.store.select(ngrx.storeState))
.map(([action, storeState]) => [action.payload, storeState])
.switchMap(([storeName, storeState]) => {
const existsInStore = Boolean(storeState.urlNameMap[storeName]);
return Observable.if(
() => existsInStore,
Observable.of(new storeActions.SetSelectedStore(storeName)),
@flashjpr
flashjpr / nginx.conf
Created August 2, 2018 00:14 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048