Skip to content

Instantly share code, notes, and snippets.

View martynchamberlin's full-sized avatar

Martyn Chamberlin martynchamberlin

View GitHub Profile
@martynchamberlin
martynchamberlin / part-2.md
Last active June 12, 2017 11:46
JavaScript ES6 Promises Example

Let's say we want to call a function that does some work, then we want to do our own work, then let the function know that we've completed our work. We could achieve that by doing this:

var s = () => {
  console.log('start');
  return Promise.resolve(() => { console.log('run after finish') });
};


const start = s();
@martynchamberlin
martynchamberlin / jekyll-post
Last active April 30, 2017 04:40
Jekyll post
#!/usr/bin/python
"""
jekyll-post - this is a simple script that will create and initialize a new
Jekyll post file. The default is a markdown file (.md) and the yaml options
listed below will be part of the initialization.
jekyll-post [-w] [-d date] [title]
title the title of the post wrapped in quotes, e.g. "post title here"