Skip to content

Instantly share code, notes, and snippets.

View matt-mcmahon's full-sized avatar
🏠
Working from home

Matt McMahon matt-mcmahon

🏠
Working from home
  • Millbury, Ohio, USA
View GitHub Profile
@matt-mcmahon
matt-mcmahon / context.js
Created May 15, 2017 13:44 — forked from bennadel/context.js
Method Binding Is An Implicit Part Of Your API Contract (Whether You Like It Or Not)
// Require the core node modules.
var chalk = require( "chalk" );
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
// I am a mock zEmbed class.
// --
// NOTE: With a traditional "class", all of the internal references use "this" because
// the methods are all located on the class prototype and do not have a lexical binding
My thoughts on writing tiny reusable modules that each do just one
thing. These notes were adapted from an email I recently sent.
***
If some component is reusable enough to be a module then the
maintenance gains are really worth the overhead of making a new
project with separate tests and docs. Splitting out a reusable
component might take 5 or 10 minutes to set up all the package
overhead but it's much easier to test and document a piece that is
@matt-mcmahon
matt-mcmahon / node-on-ubuntu-with-git.sh
Last active July 9, 2016 21:20 — forked from isaacs/node-and-npm-in-30-seconds.sh
My procedure for installing node.js on ubuntu server.
# Prerequisites:
sudo apt-get install g++ make libssl-dev git-core pkg-config
# pkg-config: is needed so that configure will be able to verify that openssl is
# installed.
# curl: is handy, but not needed for node.js to work.
# Install into user-specific local bin:
mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc