Skip to content

Instantly share code, notes, and snippets.

Thomas Urban soletan

Block or report user

Report or block soletan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@soletan
soletan / on-cepharum-coding-style-guide.md
Last active Jun 5, 2019
On Cepharum Coding Style Guide
View on-cepharum-coding-style-guide.md

Javascript

When developing Javascript code you are advised to use our ESLint configuration to implement most parts of our coding style.

Why not using Standard JS?

Standard JS is an eligible coding style for most users. Nonetheless we consider Standard JS to include some oddities we basically dislike.

For example, we guess using single quotes for strings is due to making life easier for people with QWERTY layout by saving use of Shift-key. Javascript doesn't care whether using single or double quotes. Thus, from a Javascript developer's point of view this decision comes without little bias and that's why we guess the keyboard/convenience factor was used to decide on this one. However, this benefits doesn't apply to users working with different keyboard layouts. And most other languages care a lot about the used quotes. This is even true in the family of C-like languages Javascript belongs to. In C/C++ double quotes are required to wrap multi-char

@soletan
soletan / expressjs-shutdown.js
Created Sep 27, 2015
How to shut down express js gracefully while supporting keep-alive
View expressjs-shutdown.js
// this is an excerpt of essential but non-working part extracted from local expressjs application ...
var app = require( "express" )();
var httpServer = require( "http" ).createServer( app );
httpServer.on( "connection", function( socket ) {
socket.unref();
} );
You can’t perform that action at this time.