17 private links
Infer a probabilistic schema for a MongoDB collection.
Usage
mongodb-schema
can be used as a command line tool or programmatically in your application as a node module.
mongodb-schema mongodb://localhost:27017 db.collection
$ mongodump -d some_database -c some_collection
$ mongorestore -d some_other_db -c some_or_other_collection dump/some_collection.bson
db.originalCollectionName.renameCollection('newCollectionName')
You can select the collection via:
mongodump -d some_database -c some_collection
[Optionally, zip the dump (zip some_database.zip some_database/* -r
) and scp
it elsewhere]
Then restore it:
mongorestore -d some_other_db -c some_or_other_collection dump/some_collection.bson
Existing data in some_or_other_collection
will be preserved. That way you can "append" a collection from one database to another.
Prior to version 2.4.3, you will also need to add back your indexes after you copy over your data. Starting with 2.4.3, this process is automatic, and you can disable it with --noIndexRestore
.
HTTPie—aitch-tee-tee-pie—is a command line HTTP client with an intuitive UI, JSON support, syntax highlighting, wget-like downloads, plugins, and more.
HTTPie consists of a single http command designed for painless debugging and interaction with HTTP servers, RESTful APIs, and web services:
- Sensible defaults
- Expressive and intuitive command syntax
- Colorized and formatted terminal output
- Built-in JSON support
- Persistent sessions
- Forms and file uploads
- HTTPS, proxies, and authentication support
- Support for arbitrary request data and headers
- Wget-like downloads
- Extensions
- Linux, macOS, and Windows support
Generate massive amounts of fake data in the browser and node.js
Instead of implementing XMLHttpRequest in Node.js to run browser-specific Fetch polyfill, why not go from native http to fetch API directly? Hence node-fetch, minimal code for a window.fetch compatible API on Node.js runtime.
See Matt Andrews' isomorphic-fetch or Leonardo Quixada's cross-fetch for isomorphic usage (exports node-fetch for server-side, whatwg-fetch for client-side).
SuperAgent is light-weight progressive ajax API crafted for flexibility, readability, and a low learning curve after being frustrated with many of the existing request APIs. It also works with Node.js!
Aggregation is a very small JavaScript library for Node.js environments, providing just a single function, for use in ECMAScript 5/6 class inheritance based on mixins. It aggregates a base class and one or more mixin classes into an aggregate class, which then is usually subsequently used as the base class for another class.
mics (pronounce: mix) is a library that makes multiple inheritance in Javascript a breeze. Inspired by the excellent blog post “Real” Mixins with Javascript Classes by Justin Fagnani, mics tries to build a minimal library around the concept of using class expressions (factories) as mixins. mics extends the concepts presented in the blog post by making the mixins first-class citizens that can be directly used to instantiate objects and can be mixed in with other mixins instead of just with classes.
The protocol is available as req.protocol. docs here
var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
By using above example, you can get full page URL.
Dev-test pipeline automation, 100,000+ free apps, public and private registries
The truth is, ternaries are usually much simpler than if statements. People believe the reverse for two reasons:
- They’re more familiar with if statements. Familiarity bias can lead us to believe things that aren’t true, even when we’re presented with evidence to the contrary.
- People try to use ternary statements as if they’re if statements. That doesn’t work, because ternary expressions are expressions, not statements.
Before we get into the details, let’s define a ternary expression:
A ternary expression is a conditional expression that evaluates to a value. It consists of a conditional, a truthy clause (the value to produce if the conditional evaluates to a truthy value), and a falsy clause (the value to produce if the conditional evaluates to a falsy value).
Finding D3 plugins with ease.
<Route path="/:path(path1|path2)" component={MyComp} />
Just-add-water CSS animations
react-motion - A spring that solves your animation problems.