This file contains 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 { Store, select } from ‘@ngrx/store’; | |
import { Component } from ‘@angular/core’; | |
@Component({ | |
selector: ‘app-root’, | |
template: `{{selectedId$ | async | json}}`, | |
}) | |
export class HomeComponent { | |
selectedId$ = this.store.pipe(select((state: any) => state.featureName.selectedId)); | |
constructor( | |
private store: Store, |
This file contains 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
setCurrentCourse$ = createEffect(() => this.actions$.pipe( | |
ofType(ROUTER_NAVIGATED), // get router navigated ngrx actions | |
mergeMap(() => this.store.pipe( | |
select(selectRouteParam(‘id’))) // get the id from the router store | |
), | |
map((id: string) => setIds({ id })), // dispatch a new action to set the selected id | |
)); |
This file contains 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
wp search-replace http://origin.com http://destination.com --all-tables | |
wp option update home http://destination.com | |
wp option update siteurl http://destination.com | |
# Make sure that you have write permissions first | |
wp rewrite flush |
This file contains 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
@Component({ | |
export class MyComponent { | |
id: string; | |
id$ = this.activatedRoute.params.pipe( | |
map(params => params.id), | |
tap(id => this.id = id), | |
); | |
constructor( | |
private activatedRoute: ActivatedRoute, | |
) {} |
This file contains 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
const url = require('url'); | |
const router = require('express').Router(); | |
const passport = require('passport'); | |
const jwt = require('jsonwebtoken'); | |
const User = require('../schemas/user'); | |
router.post('/register', (req, res) => { | |
if(!(req.body.email && req.body.password)) return res.status(200).send('no password or email provided'); | |
User.findByEmail(req.body.email, (err, user) => { | |
if(user.length > 0) return res.status(200).send('user with given email exists'); |
This file contains 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
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau | |
Africa/Blantyre |
OlderNewer