Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Human learning is required before the machines do.

Naveen metanav

💭
Human learning is required before the machines do.
  • RIKEN
  • Japan
View GitHub Profile
@metanav
metanav / enterZone.ts
Last active Aug 8, 2019
A RxJS pipeable operator which let the observables to enter into angular zone so that the change detection works properly.
View enterZone.ts
import { NgZone } from '@angular/core';
import { Observable } from 'rxjs/Observable';
export function enterZone(zone: NgZone) {
return <T>(source: Observable<T>) =>
new Observable<T>(observer =>
source.subscribe({
next: (x) => zone.run(() => observer.next(x)),
error: (err) => observer.error(err),
complete: () => observer.complete()
View HybridAuthAdapter.php
<?php
namespace SocialAuth\Adapter;
class HybridAuthAdapter
{
protected $hybridAuth;
public function __construct($hybridAuth)
{
$this->hybridAuth = $hybridAuth;
View aggregation_builder_example.php
<?php
$ab = $this->dm->getDocumentCollection('Document\Test')->createAggregationBuilder();
if (is_array($filter)) {
/* Here $filter is an array which could be $qb->getQuery()->getQuery()['query']
* or manually crafted
* example [ '$and' => [ 'name' => 'keyword'] ]
*/
$ab->match(); // <-- how to pass query array to match stage?
} else {