Skip to content

Instantly share code, notes, and snippets.

View burtonator's full-sized avatar

Kevin Burton burtonator

View GitHub Profile
import React from 'react';
import {useLocation} from 'react-router-dom';
import {HashURLs} from "polar-shared/src/util/HashURLs";
import {IDStr} from "polar-shared/src/util/Strings";
interface IProps {
readonly children: React.ForwardRefRenderFunction<HTMLDivElement, any>;
// readonly children: React.ReactNode;
}
import createPersistedState from "use-persisted-state";
import {MUIThemeTypeContext, ThemeType} from "./context/MUIThemeTypeContext";
import {createMuiTheme, MuiThemeProvider} from "@material-ui/core/styles";
import CssBaseline from "@material-ui/core/CssBaseline";
import {GlobalCss} from "./css/GlobalCss";
import * as React from "react";
import {GlobalCssSummernote} from "./css/GlobalCssSummernote";
import {GlobalCSSBootstrap} from "./css/GlobalCSSBootstrap";
import {FirestoreProvider} from "../../../apps/repository/js/FirestoreProvider";
import {GlobalCssMobile} from "./css/GlobalCssMobile";
import * as React from 'react';
import {RepoDocMetaLoader} from '../RepoDocMetaLoader';
import {RepoDocMetaManager} from '../RepoDocMetaManager';
import {IDocInfo} from 'polar-shared/src/metadata/IDocInfo';
import {IEventDispatcher} from '../../../../web/js/reactor/SimpleReactor';
import {PersistenceLayerManager} from '../../../../web/js/datastore/PersistenceLayerManager';
import AnnotationRepoTable from './AnnotationRepoTable';
import {UpdateFiltersCallback} from './AnnotationRepoFiltersHandler';
import {NULL_FUNCTION} from "polar-shared/src/util/Functions";
import {IDocAnnotation} from "../../../../web/js/annotation_sidebar/DocAnnotation";
import * as React from 'react';
import {Devices} from "polar-shared/src/util/Devices";
import {AnnotationRepoTable2} from './AnnotationRepoTable2';
const Main = () => (
<div style={{
display: 'flex',
flexDirection: 'column',
minHeight: 0
import React, {useCallback, useState} from "react";
import Button from "@material-ui/core/Button";
interface IProps {
readonly value: number;
readonly setValue: (value: number) => void;
}
const ChildComponent = (props: IProps) => {
import * as functions from "firebase-functions";
import express from 'express';
import {Callback} from "polar-shared/src/util/Functions";
import {Webapps} from "../../webapp/Webapps";
let app = express();
// Google-Cloud-Tasks
console.log("SSR: Running with production SSR function v7");
@burtonator
burtonator / test.ts
Last active February 26, 2020 21:16
import * as functions from "firebase-functions";
import express from 'express';
const app = express();
app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
console.log("Hello World: : handling basic request");
res.status(200).send('Hello World\n');
next();
});
import * as functions from "firebase-functions";
import express from 'express';
const app = express();
console.log("SSR: Running with minimal SSR function");
app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
console.log("SSR: : handling basic request");
res.status(200).send('Hello World\n');
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
import {createWebapp} from "../../webapp/Webapp";
import * as functions from "firebase-functions";
import express from 'express';
const app = createWebapp();
app.use(require('prerender-node').set('prerenderToken', 'xxxx'));
// https://expressjs.com/en/guide/error-handling.html
// add a better error handler
app.use(function(err: Error, req: express.Request, res: express.Response, next: express.NextFunction) {