Skip to content

Instantly share code, notes, and snippets.

View metanav's full-sized avatar
💭
Human learning is required before the machines do.

Naveen metanav

💭
Human learning is required before the machines do.
  • RIKEN
  • Japan
View GitHub Profile
class Opencv < Formula
desc "Open source computer vision library"
homepage "https://opencv.org/"
url "https://github.com/opencv/opencv/archive/refs/tags/4.8.1.tar.gz"
sha256 "62f650467a60a38794d681ae7e66e3e8cfba38f445e0bf87867e2f2cdc8be9d5"
license "Apache-2.0"
revision 4
livecheck do
url :stable
@metanav
metanav / enterZone.ts
Last active August 8, 2019 01:54
A RxJS pipeable operator which let the observables to enter into angular zone so that the change detection works properly.
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()
<?php
namespace SocialAuth\Adapter;
class HybridAuthAdapter
{
protected $hybridAuth;
public function __construct($hybridAuth)
{
$this->hybridAuth = $hybridAuth;
<?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 {