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 express = require('express'); | |
const { graphqlHTTP } = require('express-graphql'); | |
const { loadSchema } = require('@graphql-tools/load'); | |
const { JsonFileLoader } = require('@graphql-tools/json-file-loader'); | |
const app = express(); | |
// yarn codegen (with introspection plugin) must run first so ./graphql.schema.json is available to use here | |
loadSchema('./graphql.schema.json', { | |
loaders: [new JsonFileLoader()], |
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 React from "react"; | |
import { useGetCityByNameQuery } from "../generated/graphql"; | |
const Weather = () => { | |
const { data, loading, error } = useGetCityByNameQuery({ | |
variables: { | |
name: "Toronto", | |
}, | |
}); |
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 links = []; | |
var links = document.getElementsByTagName("a"); | |
for (var i = 0, max = links.length; i < max; i++) { | |
const href = links[i].href; | |
links.push(href) | |
} | |
console.log("Links", links); |
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 uniqueQueryParams = {}; | |
const occurenceCount = {} | |
const links = []; | |
for (let link of links) { | |
const url = new URL(links); | |
const params = new URLSearchParams(url.search); |
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
language: node_js | |
node_js: | |
- '8' | |
before_cache: | |
# awss3-deploy | |
- pip install --user awscli | |
before_deploy: | |
- export BUCKET=s3-deployed-app LOCAL_DIR=build | |
- npm run build |
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
image: node:8 | |
cache: | |
paths: | |
- node_modules/ | |
before_script: | |
- apt-get update | |
- apt-get install -y -qq python3-dev python3-pip | |
- pip3 install --upgrade awscli |
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 { AuthService } from './../services/auth.service'; | |
import { Injectable } from '@angular/core'; | |
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router, Route } from '@angular/router'; | |
import { Observable } from 'rxjs'; | |
@Injectable() | |
export class RoleGuard implements CanActivate { | |
constructor(private _authService: AuthService, private _router: Router) { |
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 { AuthService } from './../services/auth.service'; | |
import { Injectable } from '@angular/core'; | |
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router, Route } from '@angular/router'; | |
import { Observable } from 'rxjs'; | |
@Injectable() | |
export class AuthGuard implements CanActivate { | |
constructor(private _authService: AuthService, private _router: Router) { |
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 { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { RouterModule } from '@angular/router'; | |
import { AppComponent } from './app.component'; | |
import { LoginComponent } from './login/login.component'; | |
import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; | |
import { APP_ROUTES } from './app.routes'; | |
import { DashboardModule } from './dashboard/dashboard.module'; |
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 { Routes } from '@angular/router'; | |
import { LayoutComponent } from './layout/layout.component'; | |
import { HomeComponent } from './home/home.component'; | |
import { AdminComponent } from './admin/admin.component'; | |
export const dashboardRoutes: Routes = [ | |
{ | |
path: 'dashboard', | |
component: LayoutComponent, | |
children: [ |
NewerOlder