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
| function injectProps(options) { | |
| return function(InitialComponent) { | |
| return function DndStateInjector() { | |
| return <InitialComponent {...options} />; | |
| }; | |
| }; | |
| } |
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 ( | |
| process.env.NODE_ENV === "production" | |
| ? require("./productionStore").default | |
| : require("./developmentStore").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
| import { GraphQLInt, GraphQLNonNull, GraphQLInputObjectType } from "graphql"; | |
| import { connectionDefinitions, connectionArgs } from "graphql-relay"; | |
| import UserType from "./UserType"; | |
| // References | |
| // http://graphql.org/learn/pagination/ | |
| // http://dev.apollodata.com/react/pagination.html | |
| // https://www.reindex.io/blog/relay-graphql-pagination-with-mongodb/ | |
| // https://github.com/graphql/graphql-relay-js |
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 function formCollectionToPlainObject(HTMLFormControlsCollection) { | |
| return Object.entries(HTMLFormControlsCollection).reduce((acc, [key, value]) => { | |
| return { | |
| ...acc, | |
| [key]: value.value | |
| }; | |
| }, {}); | |
| } |
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
| creating custom Graphql Types | |
| https://github.com/stylesuxx/graphql-custom-types/blob/master/src/scalars.js |
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 stateFiles = [ | |
| {name: 'john'}, | |
| {name: 'lewis'}, | |
| ] | |
| const files = [ | |
| {name: 'ana'}, | |
| {name: 'john', email: "[email protected]"}, | |
| ] |
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, { Component } from "react" | |
| export default function hoverDecorator(InitialComponent) { | |
| return class HoverDecorator extends Component { | |
| constructor() { | |
| super() | |
| this.state = { | |
| hover: false | |
| } |
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
| git flow bugfix vs hotfix | |
| bugfix -> develop | |
| hotfix -> master |
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
| let x = 0 | |
| console.log(x) | |
| let y = 1 | |
| console.log(y) | |
| let z = 0 | |
| for (let i=0; i < 20; i++) { | |
| z = x + y |
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
| // better file checker | |
| // https://nodejs.org/dist/latest-v7.x/docs/api/fs.html#fs_fs_readfilesync_file_options | |
| fs.accessSync(path.resolve(__dirname,'./config-local.json'), fs.R_OK); | |
| // add .env.js |