npm Users By Downloads (git.io/npm-top)
npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.
Metrics are calculated using top-npm-users.
# | User | Downloads |
---|
npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.
Metrics are calculated using top-npm-users.
# | User | Downloads |
---|
Load testing is a good way to understand your website or web app behaviour under high traffic.
Here is how to use siege
, a simple CLI tool.
Note: Use siege only on sites you own as its traffic could be interpreted as a DDOS attack.
Using 100 concurrent requests and up to 3 seconds between requests:
Here’s how to make animations like this one. It requires intermediate Unix command-line knowledge, to install some tools and to debug if they don’t work. You’ll need these utilities:
curl
(or you can translate to wget
)convert
and montage
, part of ImageMagickffmpeg
, plus whatever codecsparallel
, for iteration that’s nicer than shell for loops or xargs
zsh
for leading 0s in numerical ranges to work// Usage: | |
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread | |
// then use as follows: | |
// | |
// query(term | [term, term, ...], term | [term, term, ...], ...) | |
// | |
// When arguments are in an array then that means an "or" and when they are seperate that means "and" | |
// | |
// Term is of the format: | |
// ((-)text/RegExp) ( '-' means negation ) |
// Given an iframe id and an anchor id that is present within the iframe, | |
// determine whether the element is visible/present inside the window viewport. | |
// This is not about the css 'display' property; this shows whether | |
// the window viewport contains the element. | |
var isVisible = function (anchor, iframe_id) { | |
var ifrId = iframe_id || 'bv_page'; | |
var ifrOffset = window.parent.document.getElementById(ifrId).offsetTop; | |
var myloc = document.getElementById(anchor).offsetTop + ifrOffset; | |
var viewtop = window.parent.scrollY; |
I had a lot of issues trying to get continuation-local-storage (cls) working on a hapi.js app with pm2 in cluster_mode. Long story short, my mistake was wrapping cls around my server.start() when I should have been running it in a request handler. Here is the code you should use to get all this working:
var cls = require('continuation-local-storage');
var ns = cls.createNamespace('mySession');
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.
In that post I talked about 3 main reasons for moving from require.js to webpack:
Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.
/** | |
* var jpr = new JSONPRequest(); | |
* jpr.onload = (...data) => { | |
* console.log(data); | |
* }; | |
* jpr.open('GET', 'some-url?callback={{callback}}'); | |
* jpr.send(); | |
*/ |
import React from 'react'; | |
export class Component extends React.Component { | |
constructor(...args) { | |
super(...args); | |
this.generateBindings(); | |
if (typeof this.init==='function') { | |
this.init(); | |
} | |
} |
var setImmediate = (function(f, q, p, reg) { | |
q = []; | |
f = document.createElement('iframe'); | |
f.style.cssText = 'position:absolute;top:-999em;left:0;width:1px;height:1px;'; | |
document.body.appendChild(f); | |
function done() { | |
for (var i=0; i<q.length; i++) q[i](); | |
q.length = 0; | |
} | |
p = [ |