I hereby claim:
- I am schnerd on github.
- I am dschnurr (https://keybase.io/dschnurr) on keybase.
- I have a public key ASCO-9Kbv3wNLNAhXZHflAdH3eHn9WkXsI0LAAzIpfX5Qwo
To claim this, I am signing this object:
const express = require('express'); | |
const bodyParser = require('body-parser') | |
const fetch = require('node-fetch'); | |
const app = express() | |
const port = 3008 | |
app.use(bodyParser.json()); | |
app.post('/api/generate', (req, res) => { | |
var PROMPT = req.body.subject; |
license: mit |
I hereby claim:
To claim this, I am signing this object:
function getComponents(defaultComponents, overrides) { | |
return Object.keys(defaultComponents).reduce((acc, name) => { | |
const override = overrides[name] || {}; | |
acc[name] = { | |
component: override.component || defaultComponents[name], | |
props: {$style: override.style, ...override.props}, | |
}; | |
return acc; | |
}, {}); | |
} |
// Autocomplete.js | |
import React from 'react'; | |
import * as defaultComponents from './styled-elements'; | |
class Autocomplete extends React.Component { | |
// Setup & handlers omitted to keep this example short | |
getSharedStyleProps() { | |
const {isOpen, isError} = this.state; |
// App.js | |
render() { | |
<Autocomplete | |
options={this.props.products} | |
overrides={{ | |
Root: { | |
props: {'aria-label': 'Select an option'}, | |
style: ({$isOpen}) => ({borderColor: $isOpen ? 'blue' : 'grey'}), | |
}, | |
Option: { |
import {defaultProps} from 'recompose'; | |
import glamorous from 'glamorous'; | |
import {AutocompleteBase} from './Autocomplete'; | |
export const $Root = glamorous.div({ | |
border: '1px solid #ccc', | |
width: '300px', | |
margin: '0 auto', | |
}); |
license: mit |
function wait (ms) { | |
return new Promise(resolve => setTimeout(() => resolve(), ms)); | |
} | |
export default async function capture(browser, url) { | |
// Load the specified page | |
const page = await browser.newPage(); | |
await page.goto(url, {waitUntil: 'load'}); | |
// Get the height of the rendered page |
license: mit |