Skip to content

Instantly share code, notes, and snippets.

View RayLuxembourg's full-sized avatar

Ray Luxembourg RayLuxembourg

View GitHub Profile
@RayLuxembourg
RayLuxembourg / System Design.md
Created August 21, 2021 18:32 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@RayLuxembourg
RayLuxembourg / logger.js
Created June 18, 2021 21:21 — forked from ludwig/logger.js
winston logger with filename:linenumber
// NOTE: this adds a filename and line number to winston's output
// Example output: 'info (routes/index.js:34) GET 200 /index'
var winston = require('winston')
var path = require('path')
var PROJECT_ROOT = path.join(__dirname, '..')
var logger = new winston.logger({ ... })
// this allows winston to handle output from express' morgan middleware
@RayLuxembourg
RayLuxembourg / Api.js
Created January 8, 2017 10:17 — forked from bermanboris/Api.js
Api Static Class
export default class Api {
static headers() {
return {
'Accept': 'application/json',
'Content-Type': 'application/json',
'dataType': 'json',
}
}
static get(route) {