Skip to content

Instantly share code, notes, and snippets.

Forbes Lindesay ForbesLindesay

Block or report user

Report or block ForbesLindesay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<style>
main {
width: 100%;
display: flex;
}
.column {
flex-basis: 0;
flex-grow: 1;
}
img {
View settings.json
{
"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
View keybase.md

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 Oct 20, 2017 — forked from nanot1m/iter.js
Push iterator
View iter.js
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) {
View flow-error.js
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"
View cabbie jscodeshift.js
// 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' &&
View cms.md

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.

View example1.js
// 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);
});
View .eslintrc.js
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],
View david-dm-migration.js
var github = require('github-basic');
var client = github({
version: 3,
auth: process.argv[2],
cache: 'file',
sync: true
});
function forEach(page, fn) {
You can’t perform that action at this time.