Skip to content

Instantly share code, notes, and snippets.

View philly-vanilly's full-sized avatar

Philip Lysenko philly-vanilly

View GitHub Profile
@philly-vanilly
philly-vanilly / observatory-audit-default-config.json
Created June 24, 2018 19:49
Observatory Audit For Default NGINX/Angular Config
{
"scan": {
"grade": "F",
"likelihood_indicator": "MEDIUM",
"response_headers": {
"Accept-Ranges": "bytes",
"Connection": "keep-alive",
"Content-Length": "581",
"Content-Type": "text/html",
"Date": "Sun, 24 Jun 2018 19:42:11 GMT",
{
"scan": {
"grade": "B",
"likelihood_indicator": "MEDIUM",
"response_headers": {
"Connection": "keep-alive",
"Content-Encoding": "gzip",
"Content-Security-Policy": "frame-ancestors 'none'",
"Content-Type": "text/html",
"Date": "Sat, 11 Aug 2018 16:58:51 GMT",
#!/usr/local/bin/python3.7
import itertools
import random
import ipaddress
import time
import aiohttp
import asyncio
base_url = 'http://localhost:3000'
@Component({
selector: 'app-root',
template: `<router-outlet></router-outlet>`
})
export class AppComponent {}
const lazyPathValue = 'lazy';
export const LAZY_PATH = new InjectionToken('LAZY_PATH');
@NgModule({
imports: [
RouterModule.forRoot(
[
{
path: '',
pathMatch: 'full',
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientModule,
AuthModule,
AppRoutingModule
],
// sometimes you can't use window/document/location in AOT
const origin = environment.production ? 'https://philly-vanilly.github.io/init-auth' : 'http://localhost:4200';
const configAuthZero: AuthConfig = {
issuer: 'https://philly-vanilly.auth0.com/',
customQueryParams: { audience: 'https://philly-vanilly.auth0.com/api/v2/' },
redirectUri: `${origin}/index.html`,
silentRefreshRedirectUri: `${origin}/silent-refresh.html`,
clientId: 'r4gL1ntxR2lnodnu81WFnWNOWdO5SFuV',
scope: 'openid profile email',
clearHashAfterLogin: true,
@Injectable({
providedIn: 'root'
})
export class InitialAuthService {
private jwtHelper: JwtHelperService = new JwtHelperService();
private _decodedAccessToken: any;
private _decodedIDToken: any;
get decodedAccessToken() { return this._decodedAccessToken; }
get decodedIDToken() { return this._decodedIDToken; }
import {AfterViewInit, Component, ViewChild} from '@angular/core';
import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import {PdfViewerComponent} from 'ng2-pdf-viewer';
@Component({
selector: 'app-root',
template: `
import {AfterViewInit, ChangeDetectorRef, Component, ViewChild} from '@angular/core';
import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import {PdfViewerComponent} from 'ng2-pdf-viewer';
function getMidpoint(x1, y1, x2, y2) {
const x = (x1 + x2) / 2;
const y = (y1 + y2) / 2;