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 {writeFileSync} from 'fs'; | |
import fetch from 'isomorphic-unfetch'; | |
const [, , schemaPath] = process.argv; | |
const dgraphUrl = process.env.DGRAPH_URL; | |
const dgraphToken = process.env.DGRAPH_TOKEN; | |
if (!dgraphUrl) { | |
throw new Error('You need to specify `DGRAPH_URL` in your environment.'); |
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
// Utility components on top of styled-system. | |
// Inspired by [Rebass](https://rebassjs.org/) and adopted to our needs. | |
// See: https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase | |
import {Theme} from '@/styles/theme'; | |
import css, {SystemStyleObject} from '@styled-system/css'; | |
import shouldForwardProp from '@styled-system/should-forward-prop'; | |
import { | |
ComponentPropsWithRef, | |
ComponentPropsWithoutRef, |
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 from 'react'; | |
export default function LoaderExample() { | |
comst {data, loading, error} = useMyQuery(); // Implementation specific | |
const {Loader, data: myData} = useLoader({ | |
data, | |
errorMessage: error?.message, | |
isLoading: loading, | |
}); | |
return ( |
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
/* | |
Open up the developer console in your browser, paste the script below, press enter and enjoy! | |
*/ | |
var anchors, i; | |
setInterval(function() { | |
anchors = document.getElementsByTagName('a'); | |
for (i = 0; i < anchors.length; i++) { | |
anchors[i].click(); | |
} |
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 { ApolloProvider } from '@apollo/react-hooks'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import ApolloClient from 'apollo-client'; | |
import { ApolloLink, Observable } from 'apollo-link'; | |
import React from 'react'; | |
const ErrorProvider = ({ errors, children }) => { | |
const errorLink = new ApolloLink( | |
() => | |
new Observable(observer => { |
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
$ yarn | |
$ yarn add -D typescript rollup rollup-plugin-typescript2 |
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
Show hidden characters
{ | |
"reactClassComponent": { | |
"prefix": "rcc", | |
"body": "import * as React from 'react'\n\nclass ${TM_FILENAME_BASE} extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t\t</div>\n\t\t)\n\t}\n}\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a React component class" | |
}, | |
"reactPureComponent": { | |
"prefix": "rpc", | |
"body": "import * as React from 'react'\n\nclass ${TM_FILENAME_BASE} extends React.PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t</div>\n\t\t)\n\t}\n}\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a React pure component class" |
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
{ | |
"diffEditor.renderSideBySide": false, | |
"editor.fontFamily": "Operator Mono Lig", | |
"editor.fontLigatures": true, | |
"editor.fontSize": 14, | |
"editor.formatOnSave": true, |
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
//! moment.js locale configuration | |
//! locale : finnish (fi) | |
//! author : Tarmo Aidantausta : https://github.com/bleadof | |
//! author : Christoffer Niska : https://github.com/crisu83 | |
(function (global, factory) { | |
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : | |
typeof define === 'function' && define.amd ? define(['moment'], factory) : | |
factory(global.moment) | |
}(this, function (moment) { 'use strict'; |
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
<?php | |
namespace ALehdet\AspaApi\GraphQL\Relay; | |
use Digia\GraphQL\Relay\PageInfo; | |
use Digia\GraphQL\Relay\PageInfoBuilderInterface; | |
abstract class AbstractPageBuilder implements PageInfoBuilderInterface | |
{ | |
/** |