This file contains hidden or 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
| # KEYCLOAK BASE URL | |
| KEYCLOAK_BASE_URL= | |
| # KEYCLOAK CLIENT SECRET | |
| KEYCLOAK_CLIENT_SECRET= | |
| # KEYCLOAK CLIENT ID | |
| KEYCLOAK_CLIENT_ID= | |
| # BASE URL FOR NEXT AUTH |
This file contains hidden or 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 mongoose = require('mongoose'); | |
| const toCamel = (string) => string.replace(/([-_][a-z])/gi, ($1) => $1 | |
| .toUpperCase() | |
| .replace('-', '') | |
| .replace('_', '')); | |
| const isObject = (args) => args === Object(args) && !Array.isArray(args) && typeof args !== 'function'; | |
| const keysToCamel = (args) => { |
This file contains hidden or 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
| CREATE EXTENSION IF NOT EXISTS pgcrypto; | |
| CREATE OR REPLACE FUNCTION public.nanoid(size integer DEFAULT 21) | |
| RETURNS text | |
| LANGUAGE plpgsql | |
| STABLE | |
| AS $function$ | |
| DECLARE | |
| id text := ''; | |
| i int := 0; |
This file contains hidden or 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 { ObjectType, Field } from "@nestjs/graphql"; | |
| @ObjectType() | |
| export class PageInfo { | |
| @Field({ nullable: true }) | |
| startCursor: string; | |
| @Field({ nullable: true }) | |
| endCursor: string; |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| export PROJECT_ID=$(gcloud config get-value project) | |
| export PROJECT_USER=$(gcloud config get-value core/account) # set current user | |
| export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)") | |
| export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain | |
| export GCP_REGION="us-east1" # CHANGEME (OPT) | |
| export GCP_ZONE="us-east1-c" # CHANGEME (OPT) | |
| export NETWORK_NAME="default" |
This file contains hidden or 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
| CREATE SEQUENCE public.global_id_seq; | |
| ALTER SEQUENCE public.global_id_seq OWNER TO postgres; | |
| CREATE OR REPLACE FUNCTION public.id_generator() | |
| RETURNS bigint | |
| LANGUAGE 'plpgsql' | |
| AS $BODY$ | |
| DECLARE | |
| our_epoch bigint := 1314220021721; | |
| seq_id bigint; |
This file contains hidden or 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 { withRouter, Link } from 'react-router-dom' | |
| import { graphql, compose } from 'react-apollo' | |
| import { Formik } from 'formik' | |
| import Yup from 'yup' | |
| import FormWideError from '../elements/form/FormWideError' | |
| import TextInput from '../elements/form/TextInput' | |
| import Button from '../elements/form/Button' | |
| import { H2 } from '../elements/text/Headings' |
This file contains hidden or 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 {theSaga} from "somewhere"; | |
| const ctx: Worker = self as any; | |
| const workerIO: RunSagaOptions<Action, undefined> = { | |
| subscribe: cb => { | |
| const listener = (ev: MessageEvent) => cb(ev.data); | |
| ctx.addEventListener("message", listener); | |
| return () => ctx.removeEventListener("message", listener); | |
| }, | |
| dispatch: action => ctx.postMessage(action), |
This file contains hidden or 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
| -- Create a group | |
| CREATE ROLE readaccess; | |
| -- Grant access to existing tables | |
| GRANT USAGE ON SCHEMA public TO readaccess; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
| -- Grant access to future tables | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
This file contains hidden or 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 { | |
| Route, | |
| Redirect | |
| } from 'react-router-dom' | |
| class PrivateRoute extends React.Component { | |
| render() { | |
| const { component: Component, ...rest } = this.props |
NewerOlder