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 { ApolloClient } from 'apollo-boost'; | |
| import { get as lodashGet } from 'lodash'; | |
| interface INode<T> { | |
| node: T; | |
| } | |
| interface IHaveNextPage { | |
| pageInfo: { | |
| hasNextPage: boolean; |
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 * as React from 'react'; | |
| import mitt from 'mitt'; | |
| type IEventName = | |
| | 'CommentCreated' | |
| | 'CommentDestroy' | |
| type IEventPaload = any; | |
| type IEventHandler = (payload: IEventPaload) => void; |
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 * as React from 'react'; | |
| const BOLD_REGEX = /(^|[^\w])\*\*[^\*]+\*\*($|[^\w])/gi; | |
| const ITALIC_REGEX = /(^|[^\w])(^|[^\*])\*[^\*]+\*($|[^\w])/gi; | |
| const UNDERLINE_REGEX = /(^|[^\w])(^|[^\~])\~[^\~]+\~($|[^\w])/gi; | |
| const STIKE_REGEX = /(^|[^\w])\~\~[^\~]+\~\~($|[^\w])/gi; | |
| function boldStrategy(contentBlock: any, callback: any, _contentState: any) { | |
| findWithRegex(BOLD_REGEX, contentBlock, callback); | |
| } |
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
| module SEO | |
| def self.for(record) | |
| "::SEO::#{record.class_name}".safe_constantize.new(record) | |
| end | |
| end | |
| class SEO::Base | |
| attr_reader :record | |
| def initialize(record) |
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 testPathIgnorePatterns = ['/node_modules/', '.next/', 'graphql/']; | |
| module.exports = { | |
| reporters: ['default', 'jest-junit'], | |
| projects: [ | |
| { | |
| runner: 'jest-runner-prettier', | |
| displayName: 'prettier', | |
| moduleFileExtensions: [ | |
| '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
| data = `yarn outdated` | |
| data = data.split("\n") | |
| index = data.find_index { |line| line =~ /^Package.*Current.*/ } | |
| if index.nil? | |
| print "No new dependancies\n" | |
| exit | |
| end |
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
| # frozen_string_literal: true | |
| module SpecSupport | |
| module GraphHelper | |
| def execute_mutation(current_user: nil, context: {}, **inputs) | |
| context = Graph::Context.new( | |
| query: OpenStruct.new(schema: StacksSchema), | |
| values: context.merge(current_user: current_user), | |
| object: nil, | |
| ) |
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 buildNode(todo) { | |
| return { | |
| todo, | |
| children: [], | |
| }; | |
| } | |
| function buildTree(todos) { | |
| const root = buildNode(); |
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
| /* | |
| Do you use?: | |
| Question | |
| Alternative(product) | |
| Note(product) | |
| Thanks | |
| Add to Stack: | |
| ProductSearch |
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 miniStateMachine<IComponentProps>({ | |
| initialState, | |
| actions, | |
| components: { | |
| search: Search, | |
| newProduct: NewProduct, | |
| product: Poduct, | |
| }, | |
| // WIP |