Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
var _ = require('lodash'); | |
var log = require('../core/log.js'); | |
var RSI = require('./indicators/RSI.js'); | |
// let's create our own method | |
var method = {}; | |
// prepare everything our method needs | |
method.init = function() { |
const Task = require('data.task') | |
Task.prototype.alt = function (that) { | |
return new Task((rej, res) => | |
this.fork(_ => that.fork(rej, res), res)) | |
} | |
const hosts = [ | |
[ 'db1.mysite.com', 'user', 'password' ], | |
[ 'db2.mysite.com', 'user', 'password' ], |
// font-size of the regular font used | |
$base-font-size: 16px; | |
// it is convenient to declare a fixed base-line-height, | |
// so every other line-height is a simple multiple of base-line-height | |
$base-line-height: 21px; // 1.5 * base-font-size | |
// allow fractional line-height as integer multiple of base-line-height / line-height-scale | |
$line-height-scale: 1; |
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 100, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : true, // Standard browser globals e.g. `window`, `document`. |
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.
var gulp = require('gulp'); | |
// Let's make things more readable by | |
// encapsulating each part's setup | |
// in its own method | |
function startExpress() { | |
var express = require('express'); | |
var app = express(); | |
app.use(express.static(__dirname)); |