Skip to content

Instantly share code, notes, and snippets.

# Config for graphql-code-generator
schema: ./schema.graphql
overwrite: true
generates:
./__generated__/types.ts:
plugins:
- add: '/* tslint:disable */'
- add: '// This file was automatically generated and should not be edited.'
- add: import ResolverContext from '../ResolverContext';
<style>
main {
width: 100%;
display: flex;
}
.column {
flex-basis: 0;
flex-grow: 1;
}
img {
@ForbesLindesay
ForbesLindesay / settings.json
Created September 14, 2018 10:56
VSCode Settings
{
"editor.fontFamily": "FiraCode-Regular, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"window.zoomLevel": 4,
"editor.formatOnSave": true,
"[html]": {
"editor.formatOnSave": false
},
"[json]": {
"editor.formatOnSave": false

Keybase proof

I hereby claim:

  • I am forbeslindesay on github.
  • I am forbeslindesay (https://keybase.io/forbeslindesay) on keybase.
  • I have a public key ASBrPwWIE8YtNKrmxJFoff2yxrmSMF5GMwoVQUCChuxcvwo

To claim this, I am signing this object:

@ForbesLindesay
ForbesLindesay / iter.js
Last active October 20, 2017 18:11 — forked from nanot1m/iter.js
Push iterator
const Queue = require('then-queue'); // async queue that doesn't care what order you call push and pop.
const queue = new Queue();
// push sends to the first waiting `pop` if available, otherwise it acts as a buffer
listenToNewMessages(message => queue.push(message));
async function* MessagesGenerator() {
try {
while (true) {
type Children = {
children: void | Array<Children>
message: [MessageBlame, MessageBlame, MessageBlame, MessageBlame, MessageComment, MessageBlame]
};
type Extra = {
children: void | Array<Children>
message: [MessageBlame, MessageBlame, MessageBlame, MessageBlame, MessageComment, MessageBlame] | [MessageBlame, MessageBlame]
};
type FlowErrorDuplicateProvider = {
kind: "duplicate provider"
// Press ctrl+space for code completion
export default function transformer(file, api) {
const j = api.jscodeshift;
let source = file.source;
let root = j(source);
// remove "use strict"
root.find(j.ExpressionStatement).filter(path => (
path.value.expression.type === 'Literal' &&

Making a CMS using Heroku, GitHub, node.js and React

Create a repository to be hold static website/content (done)

This repo will ultimately contain all the templates and code needed to render your website. It should deploy to Amazon S3 using travis. You can follow the instructions on https://simplestaticsite.org/ to get started.

Define Content Types

In the static repository, create a folder called "content". In this folder you can define each of the content types.

// assume that the optimiser doesn't know the base promise is never resolved
let resolve, reject;
const base = new Promise((_resolve, _reject) => {resolve = _resolve; reject = _reject;});
const end = new Promise(resolve => {
const middlePromise = new Promise(resolve => {
setTimeout(() => resolve(base), 1000);
});
resolve(middlePromise);
});
module.exports = {
parser: 'babel-eslint',
rules: {
// possible errors
'comma-dangle': [2, 'always-multiline'],
'no-constant-condition': [2],
'no-control-regex': [2],
'no-debugger': [2],
'no-dupe-args': [2],
'no-dupe-keys': [2],