Skip to content

Instantly share code, notes, and snippets.

View gerard-morera's full-sized avatar

Gerard Morera gerard-morera

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gerard-morera on github.
  • I am gerardmorera (https://keybase.io/gerardmorera) on keybase.
  • I have a public key ASCtMV88o9k4ZoMFduGjt7TOL9B1KJjc0nEl5WffGKNCFQo

To claim this, I am signing this object:

#The aim of this ticket is to handle Pachinko responses. I will show you three different solutions my code has been
#through and will give the reasons about its evolution.
#we are facing 4 different ways to handle responses
# - When is 200 return pending
# - When pachinko returns 500...599 retry the call if allowed or log and fails
# - When the client returns an exception retry the call if allowed or log and fails
# - When is 400...499 log and fails
#Total retries can sum until 3
@gerard-morera
gerard-morera / introrx.md
Created March 4, 2017 13:35 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
“Here is a simplified implementation, though there are plenty of more robust versions available.
var memoize = function(f) {
var cache = {};
return function() {
var arg_str = JSON.stringify(arguments);
cache[arg_str] = cache[arg_str] || f.apply(f, arguments);
return cache[arg_str];
};
@gerard-morera
gerard-morera / gist:9e694f6951074c3ef06e
Last active January 21, 2016 23:55
Javascript notes
--------------Scope----------------
---localScope---
A local scope refers to any scope defined past the global scope.
If I define a function and create variables inside it, those
variables becomes locally scoped.
// Scope A: Global scope out here