Skip to content

Instantly share code, notes, and snippets.

View jrodl3r's full-sized avatar

John Rodler jrodl3r

View GitHub Profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// window opacity
opacity: 0.95,
// choose either `'stable'` for receiving highly polished,
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'call' of undefined
TypeError: Cannot read property 'call' of undefined
at __webpack_require__ (/app/dist/server.js:142715:30)
at Function.requireEnsure [as e] (/app/dist/server.js:142734:25)
at ɵ1 (/app/dist/server.js:142985:38)
at RouterConfigLoader.loadModuleFactory (/app/dist/server.js:152511:39)
at RouterConfigLoader.load (/app/dist/server.js:152496:35)
at MergeMapSubscriber.project (/app/dist/server.js:151499:47)
at MergeMapSubscriber._tryNext (/app/dist/server.js:41981:27)
at MergeMapSubscriber._next (/app/dist/server.js:41971:18)
⚡ nr build:ssr
> [email protected] build:ssr /app
> npm run build:bundles && npm run compile:server
> [email protected] build:bundles /app
> ng build --prod && ng run ng-fire-universal:server:production --bundleDependencies all
⚡ nr build:ssr
> [email protected] build:ssr /app
> npm run build:bundles && npm run compile:server
> [email protected] build:bundles /app
> ng build --prod && ng run ng-fire-universal:server:production --bundleDependencies all
@jrodl3r
jrodl3r / search.service.ts
Last active November 1, 2019 18:16
ElasticSearch - Angular Search Service
export class SearchService {
data: any;
results: IContact[];
isFetching = false;
constructor(private functions: AngularFireFunctions) { }
public getResults(query: string) {
const call = this.functions.httpsCallable('searchContacts');
this.isFetching = true;
@jrodl3r
jrodl3r / search.component.ts
Last active November 2, 2019 20:41
ElasticSearch - Angular Search Component
import { Component, OnDestroy, ViewChild, ElementRef } from '@angular/core';
import { Subscription, Subject, of } from 'rxjs';
import { debounceTime, delay, distinctUntilChanged, flatMap, map, tap } from 'rxjs/operators';
import { SearchService } from '../../services/search.service';
@Component({
selector: 'app-searchbox',
templateUrl: './searchbox.component.html',
styleUrls: ['./searchbox.component.scss']
@jrodl3r
jrodl3r / search.component.html
Last active November 2, 2019 20:42
ElasticSearch - Angular Search Template
<div class="searchbox">
<input
#searchInput
type="text"
placeholder="Find a Person or Contact"
(keyup)="updateSearch.next($event)"
(focus)="showResults()">
<i
class="search-icon fa fa-search"
(click)="focusInput()"
@jrodl3r
jrodl3r / search.component.scss
Last active November 1, 2019 19:04
ElasticSearch - Angular Search Styles
.searchbox {
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
max-width: 480px;
margin: 0 auto;
padding: 15px;
input {
@jrodl3r
jrodl3r / index.ts
Last active November 1, 2019 20:21
ElasticSearch - Cloud Functions
import * as functions from 'firebase-functions';
import * as firebase from 'firebase-admin';
firebase.initializeApp();
const env = functions.config();
const auth = {
username: env.elasticsearch.username,
password: env.elasticsearch.password,
};