Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| var cluster = require('cluster'); | |
| var PORT = +process.env.PORT || 1337; | |
| if (cluster.isMaster) { | |
| // In real life, you'd probably use more than just 2 workers, | |
| // and perhaps not put the master and worker in the same file. | |
| cluster.fork(); | |
| cluster.fork(); | |
| cluster.on('disconnect', function(worker) { |
| if [ -f "$rvm_path/scripts/rvm" ]; then | |
| source "$rvm_path/scripts/rvm" | |
| if [ -f ".rvmrc" ]; then | |
| source ".rvmrc" | |
| fi | |
| if [ -f ".ruby-version" ]; then | |
| rvm use `cat .ruby-version` | |
| fi |
| var Db = require('mongodb').Db; | |
| var Connection = require('mongodb').Connection; | |
| var Server = require('mongodb').Server; | |
| //the MongoDB connection | |
| var connectionInstance; | |
| module.exports = function(callback) { | |
| //if already we have a connection, don't connect to database again | |
| if (connectionInstance) { | |
| callback(connectionInstance); |
| var mongoDbConnection = require('./lib/connection.js'); | |
| exports.index = function(req, res, next) { | |
| mongoDbConnection(function(databaseConnection) { | |
| databaseConnection.collection('collectionName', function(error, collection) { | |
| collection.find().toArray(function(error, results) { | |
| //blah blah | |
| }); | |
| }); | |
| }); |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| protractor.wrapDriver | |
| protractor.setInstance | |
| protractor.getInstance | |
| protractor.By | |
| protractor.By.binding | |
| protractor.By.select | |
| protractor.By.selectedOption | |
| protractor.By.input | |
| protractor.By.repeater |
https://github.com/djvirgen/virgen-acl Simple and elegant, create your own checks. No middleware?
https://github.com/OptimalBits/node_acl Use as middleware, create your own roles and access. Great choice.
https://github.com/tschaub/authorized Similar to connect roles... but a bit more robust? you can create roles and action, and associate many roles with that action
WARNING: If you're reading this in 2021 or later, you're likely better served by reading:
(This gist was created in 2013 and targeted the legacy GOPATH mode.)
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"Backbone is great but I continually found the default sorting method limited due to the following:
Disc 1, Disc 2, … Disc 10 would become Disc 1, Disc 10, Disc 2
With the help of Jim Palmer's naturalSort.js, I was able to integrate natrual sorting into Backbone.Collection.
Backbone collections are automatically sorted and now, by simply adding sortType:"natural", your collections can be sorted naturally.