Skip to content

Instantly share code, notes, and snippets.

View InputNeuron's full-sized avatar

Kevin Burton InputNeuron

View GitHub Profile
function hasUserGroup() {
return exists(/databases/$(database)/documents/user_group/$(request.auth.uid));
}
function getUserGroup() {
return get(/databases/$(database)/documents/user_group/$(request.auth.uid));
}
function isPermittedGroupWithinSet(allowedGroups, groups) {
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', 'xxxxxxxxx'));
// 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) {
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) {
* 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 * 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');
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';
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");
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 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 * 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";