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 { View, Text, TextInput, StyleSheet } from 'react-native'; | |
const styles = StyleSheet.create({ | |
wrapper: { | |
width: '90%', | |
height: 24, | |
position: 'relative', | |
alignSelf: 'center', | |
}, |
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 { types, Client, Pool } = require('pg'); | |
const Knex = require('knex'); | |
const knex = new Knex({ | |
client: 'pg', | |
connection: 'postgresql://localhost/postgres', | |
}); | |
const benchmark = async (fn, num) => { | |
const start = new Date().getTime(); |
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 and add to your Editor's plugins | |
import { RichUtils } from 'draft-js'; | |
const HEADING = 'header-one'; | |
export default () => ({ | |
onChange: (editorState) => { | |
const currentContent = editorState.getCurrentContent(); | |
const firstBlockKey = currentContent.getBlockMap().first().getKey(); |
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
/* eslint-disable no-console */ | |
import Koa from 'koa'; | |
import bodyParser from 'koa-bodyparser'; | |
import cors from 'kcors'; | |
import { SubscriptionServer as WebSocketServer } from 'subscriptions-transport-ws'; | |
import { execute, subscribe } from 'graphql'; | |
import { graphqlKoa, graphiqlKoa as graphiqal } from 'graphql-server-koa'; | |
import { formatError, isInstance } from 'apollo-errors'; |
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
export default async (knex) => { | |
const foreignKeys = await knex('pg_constraint') | |
.select('*') | |
.where('contype', '=', 'f'); | |
const queries = foreignKeys.map(async foreignKey => { | |
const [keyData] = await knex('pg_class') | |
.select('relname') | |
.where('oid', '=', foreignKey.conrelid); | |