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 { createServer } from 'http'; | |
import { execute, subscribe } from 'graphql'; | |
import { SubscriptionServer } from 'subscriptions-transport-ws'; | |
import { makeExecutableSchema } from '@graphql-tools/schema'; | |
import express from 'express'; | |
import { ApolloServer } from 'apollo-server-express'; | |
import { gql } from 'apollo-server-core'; | |
import { PubSub } from 'graphql-subscriptions'; |
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 React, { Component } from "react"; | |
import { PropTypes } from "prop-types"; | |
import { postData, getLikeBusinessEndpoint } from "../../utils/"; | |
import CheckAuth from "../checkAuth/CheckAuth"; | |
class LikeBusinessButton extends Component { | |
state = { | |
isLiked: this.props.isLiked | |
}; |
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 React, { Component } from "react"; | |
import { PropTypes } from "prop-types"; | |
import { postData, getLikeBusinessEndpoint } from "../../utils/"; | |
import CheckAuth from "../checkAuth/CheckAuth"; | |
class LikeBusinessButton extends Component { | |
state = { | |
isLiked: this.props.isLiked | |
}; |
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
// Description: | |
// This simple component is from a production code I'm currently working on. | |
// It is for triggering the loading of more contents from the server. | |
// Once the data arive from server, hand it over to the parent component that needs the data | |
// | |
// Note: This gits doesn't use the functional setState pattern, for the sake of brevity. | |
import React, { Component } from "react"; | |
class LoadMore extends Component { |
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
// Bonfire: Roman Numeral Converter | |
// Author: @dajust | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-roman-numeral-converter?solution=var%20romanNumeralMap%20%3D%20%7B%0A%20%200%20%20%20%20%3A%20%27%27%2C%20%0A%20%201%20%20%20%20%3A%20%27I%27%2C%20%0A%20%202%20%20%20%20%3A%20%27II%27%2C%20%0A%20%203%20%20%20%20%3A%20%27III%27%2C%20%0A%20%204%20%20%20%20%3A%20%27IV%27%2C%20%0A%20%205%20%20%20%20%3A%20%27V%27%2C%0A%20%206%20%20%20%20%3A%20%27VI%27%2C%0A%20%207%20%20%20%20%3A%20%27VII%27%2C%0A%20%208%20%20%20%20%3A%20%27VIII%27%2C%0A%20%209%20%20%20%20%3A%20%27IX%27%2C%0A%20%2010%20%20%20%3A%20%27X%27%2C%0A%20%2020%20%20%20%3A%20%27XX%27%2C%0A%20%2030%20%20%20%3A%20%27XXX%27%2C%0A%20%2040%20%20%20%3A%20%27XL%27%2C%0A%20%2050%20%20%20%3A%20%27L%27%2C%0A%20%2060%20%20%20%3A%20%27LX%27%2C%0A%20%2070%20%20%20%3A%20%27LXX%27%2C%0A%20%2080%20%20%20%3A%20%27LXXX%27%2C%0A%20%2090%20%20%20%3A%20%27XC%27%2C%0A%20%20100%20%20%3A%20%27C%27%2C%0A%20%20200%20%20%3A%20%27CC%27%2C%0A%20%20300%20%20%3A%20%27CCC%27 |