17 private links
Bull is a Node library that implements a fast and robust queue system based on redis.
Although it is possible to implement queues directly using Redis commands, this library provides an API that takes care of all the low-level details and enriches Redis basic functionality so that more complex use-cases can be handled easily.
If you are new to queues you may wonder why they are needed after all. Queues can solve many different problems in an elegant way, from smoothing out processing peaks to creating robust communication channels between microservices or offloading heavy work from one server to many smaller workers, etc.
HTTP assertions made easy via superagent.
The motivation with this module is to provide a high-level abstraction for testing HTTP, while still allowing you to drop down to the lower-level API provided by superagent.
Moment-iterator is a moment-js addons, to iterate through date range, or create date range.
<!-- language-all: lang-js -->
Using Javascript on the server side like that requires that you use callbacks. You cannot "return" them like you want, you can however write a function to perform actions on the results.
sequelize.query(query).success(function(row) {
// Here is where you do your stuff on row
// End the process
process.exit();
}
A more practical example, in an express route handler:
// Create a session
app.post("/login", function(req, res) {
var username = req.body.username,
password = req.body.password;
// Obviously, do not inject this directly into the query in the real
// world ---- VERY BAD.
return sequelize
.query("SELECT * FROM users WHERE username = '" + username + "'")
.success(function(row) {
// Also - never store passwords in plain text
if (row.password === password) {
req.session.user = row;
return res.json({success: true});
}
else {
return res.json({success: false, incorrect: true});
}
});
});
Ignore injection and plain text password example - for brevity.
Functions act as "closures" by storing references to any variable in the scope the function is defined in. In my above example, the correct res
value is stored for reference per request by the callback I've supplied to sequelize. The direct benefit of this is that more requests can be handled while the query is running and once it's finished more code will be executed. If this wasn't the case, then your process (assuming Node.js) would wait for that one query to finish block all other requests. This is not desired. The callback style is such that your code can do what it needs and move on, waiting for important or processer heavy pieces to finish up and call a function once complete.
EDIT
The API for handling callbacks has changed since answering this question. Sequelize now returns a Promise
from .query
so changing .success
to .then
should be all you need to do.
nivo provides a rich set of dataviz components, built on top of the awesome d3 and Reactjs libraries.
Ce jeu de données provient d'un service public certifié
Fichier de correspondance entre les codes communes (INSEE) et les codes postaux au format csv.
Ce fichier comprend :
- Le code commune INSEE
- Le nom de la commune
- Le code postal
- Le libellé d’acheminement
- La ligne 5 de l'adresse (précision de l'ancienne commune ou du lieu-dit)
Il correspond aux codes postaux de France (métropole et DOM), ceux des TOM, ainsi que MONACO.
ConnectionStrings.com helps developers connect software to data. It's a straight to the point reference about connection strings, a knowledge base of articles and database connectivity content and a host of Q & A forums where developers help each other in finding solutions. »
A React.js component to display an interactive SVG map.
Use magit-ediff or 'e' on an unmerged item to resolve merge conflicts with ediff. Magit will set up an ediff with three buffers A, B and C. A and B are the original (conflicting) files, and C is the conflicted merge.
WebPerl uses the power of WebAssembly and Emscripten to let you run Perl in the browser!
WebPerl does not translate your Perl code to JavaScript, instead, it is a port of the perl binary to WebAssembly, so that you have the full power of Perl at your disposal!
<script src="webperl.js"></script>
<script type="text/perl">
print "Hello, Perl World!\n"; # goes to JavaScript console by default
js('document')->getElementById('my_button')
->addEventListener('click', sub {
js('window')->alert("You clicked the button!");
} );
</script>
Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js.
Sometimes, Docker’s internet connectivity won’t be working properly, which can lead to a number of obscure errors with your applications. In my experience, this is usually because DNS lookups are failing in Docker images.
Analyze and debug JavaScript (or Sass or LESS) code bloat through source maps.
The source map explorer determines which file each byte in your minified code came from. It shows you a treemap visualization to help you debug where all the code is coming from.