Skip to content

Instantly share code, notes, and snippets.


Talles L tallesl

  • Belo Horizonte, Brazil
View GitHub Profile
vasanthk / System
Last active March 25, 2023 23:40
System Design Cheatsheet
View System

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?
jorinvo /
Last active November 24, 2021 02:47
This is a little challenge to find out which tools programmers use to get their everyday tasks done quickly.

You got your hands on some data that was leaked from a social network and you want to help the poor people.

Luckily you know a government service to automatically block a list of credit cards.

The service is a little old school though and you have to upload a CSV file in the exact format. The upload fails if the CSV file contains invalid data.

The CSV files should have two columns, Name and Credit Card. Also, it must be named after the following pattern:


nolanlawson / protips.js
Last active March 4, 2023 02:32
Promise protips - stuff I wish I had known when I started with Promises
View protips.js
// Promise.all is good for executing many promises at once
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
justmoon / custom-error.js
Last active March 21, 2023 14:23 — forked from subfuzion/
Creating custom Error classes in Node.js
View custom-error.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor); =;
this.message = message;
this.extra = extra;
require('util').inherits(module.exports, Error);
genadyo / gist:295a5e8f0d743f57137f
Created November 27, 2014 17:21
View gist:295a5e8f0d743f57137f
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",
kachayev /
Last active January 1, 2023 20:57
Channels Are Not Enough or Why Pipelining Is Not That Easy
staltz /
Last active March 25, 2023 13:28
The introduction to Reactive Programming you've been missing
rhythmus /
Last active October 4, 2018 10:44
Proposal for a lightweight, database-less, general purpose, name-based file management app

Proposal for a lightweight, database-less, general purpose, name-based file management app

First draft, Easter Sunday 2014

In line with current trends toward lean and simple software solutions reviving and repurposing long-established standards (open plain text vs proprietary rich text formats; file-based static site generators vs bloated database-driven CMSs), the present proposal inquires into a method (and its application) to device a lightweight, general-purpose solution for small-scale digital asset management.

No database is to be used, there shall be no external dependencies, all information carriers should be self-containing, and everything would be file-based. The software would build on a (yet to be established) convention of file naming, which would store metadata for arbitrary files inside the file name, advancing its portability across platforms.

Put as a — somewhat far-fetched — YC-style one-liner pitch: this proposal is about *

samwize / mocha-guide-to-testing.js
Created February 8, 2014 05:53
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
View mocha-guide-to-testing.js
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
// Which means, `before()` is run before first it()/describe()
mjhm / mongo_coll_update_test.js
Created January 22, 2013 04:18
This is a performance test of several methods of updating every item in 100000 row MongoDB collection. See comment below for results of test on a small EC2 instance.
View mongo_coll_update_test.js
#! /usr/bin/node
var MongoClient = require('mongodb').MongoClient
var Server = require('mongodb').Server;
var async = require('async');
var util = require('util');
// A simple linear congruence random number generator.
// This is anticipating doing a comparable test with the aggregation pipeline.
var randMod = 2 << 24;