Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sarathkumar6's full-sized avatar
👨‍💻
Trying to do better everyday

S@r@th N@g@r@j sarathkumar6

👨‍💻
Trying to do better everyday
View GitHub Profile
@sarathkumar6
sarathkumar6 / thoughts.md
Created September 22, 2020 11:52 — forked from kevinswiber/thoughts.md
Some thoughts on RFC 6902 - JavaScript Object Notation (JSON) Patch

Thoughts on JSON Patch

Introduction

JSON Patch is a media type developed to take advantage of the HTTP PATCH method. It includes operations such as add, remove, replace, copy, move, and test. Below is a first reaction to reading the specification. Note that the author has not attempted a real implementation of JSON Patch, which would certainly provide a more thorough analysis and different perspective.

Benefits

  1. The JSON Patch specification provides an actual media type to use with PATCH. This enables the PATCH method to be usable across client-server implementations. It's a real attempt at solving the partial update problem in Web APIs.
  2. JSON Patch documents allow shallow and nested object updates.
@sarathkumar6
sarathkumar6 / simple-pagination.js
Created September 10, 2019 02:52 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@sarathkumar6
sarathkumar6 / System Design.md
Created May 21, 2019 09:40 — 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?