Skip to content

Instantly share code, notes, and snippets.

View amwmedia's full-sized avatar

Andrew Worcester amwmedia

View GitHub Profile
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@adyngom
adyngom / fn-args-required.js
Last active September 26, 2017 13:56
Javascript ES6 function with required arguments example
const throwIfMissing = (p) => { throw new Error(`Missing parameter: ${p}`); }
function famTree(dad = throwIfMissing("dad"),mom = throwIfMissing("mom"),...siblings) {
console.group("Family");
console.log(`Dad: ${dad}`);
console.log(`Mom: ${mom}`);
if(siblings.length > 0) {
console.log(`Siblings: ${siblings.join()}`);
}
console.groupEnd();
@smt
smt / gh-whitespace-bookmarklet.txt
Last active May 5, 2017 20:07
GitHub magic query params
javascript:(function(w)%7Bvar%20W%3D1%2CTS%3D4%2Cl%3Dw.location%2Cqs%3Bif(l.search)%7Bqs%3Dl.search.split(\'%3F\')%5B1%5D.split(\'%26\').reduce(function(acc%2Cp)%7Bvar%20kv%3Dp.split(\'%3D\')%3Bacc%5Bkv%5B0%5D%5D%3Dkv%5B1%5D%3Breturn%20acc%7D%2C%7B%7D)%3Bqs.w%3DW%3Bqs.ts%3DTS%3Bl.search%3D\'%3F\'%2B(Object.keys(qs).reduce(function(acc%2Ck)%7Bacc.push(k%2B\'%3D\'%2Bqs%5Bk%5D)%3Breturn%20acc%7D%2C%5B%5D).join(\'%26\'))%7Delse%7Bl.search%3D\'%3Fw%3D\'%2BW%2B\'%26ts%3D\'%2BTS%7D%7D)(window)
@parshap
parshap / sphero-with-node.md
Last active December 28, 2015 22:19
Orbotix Sphero with Node.js

Sphero with Node

This document will help you get started with controlling an Orbotix Sphero using Node.js.

Client Libraries

There are several different libraries for controlling the Sphero. Currently, the best one seems to be spheron. This module provides a simple interface to the Sphero API.

There is also CylonJS, but this just uses the spheron module and exposes the same API, so unless you are already using Cylon to control different hardware it probably makes sense to just use spheron directly.