Skip to content

Instantly share code, notes, and snippets.

View nathan5x's full-sized avatar
:octocat:
Design + Code = Craft

Sabarinathan Masilamani nathan5x

:octocat:
Design + Code = Craft
View GitHub Profile
@theodorosploumis
theodorosploumis / Nework_throttling_profiles.md
Last active April 26, 2024 15:21
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@tilmanschweitzer
tilmanschweitzer / intercept-function.js
Last active September 23, 2022 18:25
Function to intercept functions calls even to nativ functions.
function interceptFunction (object, fnName, options) {
var noop = function () {};
var fnToWrap = object[fnName];
var before = options.before || noop;
var after = options.after || noop;
object[fnName] = function () {
before.apply(this, arguments);
var result = fnToWrap.apply(this, arguments);
after.apply(this, arguments);