This file contains 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
// APP_ROOT/server.js | |
const { Meep: ReactSSR } = require("./src/ssr") | |
const sheet = new ServerStyleSheet() | |
try { | |
const html = renderToString(sheet.collectStyles(<ReactSSR />)) | |
const styleTags = sheet.getStyleTags() // or sheet.getStyleElement(); | |
} catch (error) { | |
// handle error |
This file contains 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
// ROOT/server.js | |
const express = require("express") | |
const { renderToString } = require("react-dom/server") | |
const { ServerStyleSheet } = require("styled-components") | |
const SSR = require("./static") | |
const { Meep: ReactSSR } = require("./src/ssr") |
This file contains 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 React = require("react") | |
const ReactDOM = require("react-dom") | |
const Meep = ( | |
<div | |
style={{ backgroundColor: "blue", fontColor: "white" }} | |
onClick={() => alert("hello")} | |
> | |
Hello world? | |
</div> |
This file contains 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
// These are the introspection queries (note POST method) by GraphQL Playground | |
2019-07-18T22:14:14.319808+00:00 heroku[router]: at=info method=POST path="/graphql" host=eddie-faux-gram.herokuapp.com request_id=458285a3-d959-453b-b259-3440c13647dc fwd="73.70.116.10" dyno=web.1 connect=1ms service=7ms status=500 bytes=429 protocol=https | |
// These are subscriptions | |
2019-07-18T22:14:18.412631+00:00 heroku[router]: at=info method=GET path="/subscriptions" host=eddie-faux-gram.herokuapp.com request_id=4c0b335a-a4fc-4906-a899-9ca74c36ff0f fwd="73.70.116.10" dyno=web.1 connect=1ms service=191ms status=101 bytes=165 protocol=http |
This file contains 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
// https://gist.github.com/theednaffattack/790b3dc87d3c0c02227c2494e5daf15e | |
import { Button as MyButton, ButtonProps, Text } from "rebass"; | |
import { | |
borderRadius, | |
boxShadow, | |
BorderRadiusProps, | |
BoxShadowProps, | |
TLengthStyledSystem | |
} from "styled-system"; |
This file contains 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 { Flex as FlexBase, FlexProps } from "rebass"; | |
import { | |
maxWidth, | |
minHeight, | |
borders, | |
MinHeightProps, | |
BordersProps | |
} from "styled-system"; | |
import styled from "styled-components"; |
This file contains 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 { SpaceProps } from "styled-system"; | |
type TStyledLi = DetailedHTMLProps< | |
LiHTMLAttributes<HTMLLIElement>, | |
HTMLLIElement | |
> & | |
SpaceProps; | |
export const StyledLi: React.FC<TStyledLi> = styled.li` |
This file contains 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
#! /bin/bash | |
yarn build:server | |
docker build -t <DOCKER_REGISTRY_USERNAME>/<DOCKER_IMAGE_NAME>:<DOCKER_TAG> ./PATH/TO/DOCKERFILE | |
docker push <DOCKER_REGISTRY_USERNAME>/<DOCKER_IMAGE_NAME>:<DOCKER_TAG> | |
ssh <SSH_USER>@<SERVER_IP> "cd <DIRECTORY_OF_ALREADY_DEPLOYED_DOCKER-COMPOSE.YML_FILE> && docker-compose pull && docker-compose up" |
This file contains 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
-- migrate:up | |
SET search_path TO public; | |
CREATE TYPE role AS ENUM ('guest', 'administrator', 'moderator', 'manager'); | |
ALTER TABLE ONLY public.user | |
ADD roles role; | |
-- migrate:down |
This file contains 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 { ReactElement } from "react"; | |
import { frontMatter as blogPosts } from "./blog/*.mdx"; | |
import BlogPost from "../components/blog-post"; | |
const Blog = (): ReactElement[] => | |
blogPosts.map((frontMatter) => ( | |
<BlogPost key={frontMatter.title} {...frontMatter} /> | |
)); |