Skip to content

Instantly share code, notes, and snippets.

@hartliddell
hartliddell / knight-moves.js
Created October 5, 2016 15:10
Toptal Codility Problem: Can Knight reach square?
'use strict';
function getNextPositions(start) {
var moves = [
{ x: -2, y: -1 },
{ x: -2, y: +1 },
{ x: -1, y: -2 },
{ x: -1, y: +2 },
{ x: +1, y: -2 },
{ x: +1, y: +2 },
@hartliddell
hartliddell / InfiniteScroll-ES6.js
Created May 7, 2016 20:52 — forked from ChrisLTD/InfiniteScroll-ES6.js
Infinite "Scroll" javascript module for ES6
'use strict';
// Infinite scrolling loader, fires off a button click
//
// Sample HTML:
// <div id="infinite-scroll" class="js-infinite-scroll">
// POSTS HERE
// <a href="/url-to-more-content" class="js-infinite-scroll-next-button">Load More</a>
// </div>
// <div class="js-infinite-scroll-loading">...</div>
@hartliddell
hartliddell / Google-Sheet-Form-Post.md
Created October 14, 2015 18:03 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Run example

You should be able to just open index.html in your browser and test locally.

However if there are some permissions errors you can make a quick html server with python. Open terminal and cd to the directory where the gist files are located and enter python -m SimpleHTTPServer. By default this creates a local server at localhost:8000