Skip to content

Instantly share code, notes, and snippets.

View jeremyjs's full-sized avatar

Jeremy Meyer jeremyjs

  • San Francisco, CA
View GitHub Profile
@jeremyjs
jeremyjs / das_download.rb
Last active April 10, 2018 20:04 — forked from ckahle33/das.rb
#!/usr/bin/env ruby
#
# requirements:
# gem install mechanize
#
# usage:
# das_download.rb [download_directory]
require 'mechanize'
@jeremyjs
jeremyjs / publish-counts-issue-35.js
Last active August 29, 2015 14:27 — forked from boxofrox/publish-counts-issue-35.js
Reactive publish-counts with computation example
// Don't leak observes in Meteor.publish callback.
// Define only one instance for server of buyer and distributor ids for reactive counts.
var BuyerQueue = new Meteor.Collection(null);
var DistributorQueue = new Meteor.Collection(null);
function isBuyer (doc) {
return _.include(doc.roles, 'buyer');
}

CONSTANT_NAME variable_name ClassName functionName

  1. Naming things is cheap--have DESCRIPTIVE NAMES. It should read as close to natural language as possible, avoiding abbrevs. and in-house language when possible.

  2. Functions should have one thing they do. Endeavor to have pure functions, so that they do not have side effects. Functions should be have a maximum of three arguments. Good functions have one or two.

  3. Avoid being clever and implicit whenever possible.