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 / react-table-with-server-sorting-and-pagination.jsx
Last active April 9, 2024 04:48
react-table manual sort and pagination
import React, { useState, useEffect, useCallback } from "react";
import { useTable, useSortBy, usePagination } from "react-table";
import makeData from "./makeData";
const serverData = makeData(10000);
function Table({
columns,
data,
fetchData,
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;
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: `
@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; }
// 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,
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientModule,
AuthModule,
AppRoutingModule
],
const lazyPathValue = 'lazy';
export const LAZY_PATH = new InjectionToken('LAZY_PATH');
@NgModule({
imports: [
RouterModule.forRoot(
[
{
path: '',
pathMatch: 'full',
@Component({
selector: 'app-root',
template: `<router-outlet></router-outlet>`
})
export class AppComponent {}
#!/usr/local/bin/python3.7
import itertools
import random
import ipaddress
import time
import aiohttp
import asyncio
base_url = 'http://localhost:3000'
{
"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",