Skip to content

Instantly share code, notes, and snippets.

[
{
"_id": "51ef8fe7fa16ba942bdefaa5",
"background": "default",
"id": "edgemakers.1374654439814",
"lastUpdated": 1374654439814,
"members": {
"murallytest22": {
"username": "murallytest22",
"role": "owner"
var MongoClient = require('mongodb').MongoClient;
var OPTIONS = { db: { native_parser: false }, replSet: { keepAlive: 1, connectTimeoutMS: 0, socketTimeoutMS: 0 } };
var current = null;
module.exports = function(callback) {
if(current && (current._state == 'connected' || current.serverConfig.isConnected())) {
return callback(current);
}
@johnnyhalife
johnnyhalife / lapapa.js
Created July 5, 2013 01:10
get db es la papa
// ./lib/controllers/user.js
var getDb = require('mongo-getdb');
var controller = module.exports;
controller.getUserById = function(id, callback) {
var criteria = { username: id, deleted: { $ne: true } };
this.getUserByCriteria(criteria, callback);
};
@johnnyhalife
johnnyhalife / 20130704.md
Last active December 19, 2015 08:39
TO DO 2013/07/04
  • From beta. www. to bare mural.ly (wrap up what's remaining)

FTE

  • OAuth for FTE
  • Symmetric Signing Key for Loging
  • Create account out of band
- [ ] Johnny Halife
- [ ] Johnny Halife
- [ ] Johnny Halife
// estamos usando mongoskin (npm install mongoskin)
var mongoskin = require('mongoskin');
// Si te estas conectando a un cluster con replica set, etc.
var matches = /mongodb:\/\/([^:]+):([^@]+)@([^\/]+)\/(.*)/.exec(process.env.MONGOLAB_URI);
var servers = matches[3].split(',').map(function(e){ return e + "?auto_reconnect=true&poolSize=4"; });
var dbOpts = {username: matches[1], password: matches[2], database: matches[4], safe: true, native_parser: false };
var socketOptions = { keepAlive: 1, connectTimeoutMS: 0, socketTimeoutMS: 0};
var db = mongoskin.db(servers, dbOpts, { rs_name: "rs-ds041197", socketOptions: socketOptions });
url=/version, err=EROFS, stat 'C:\DWASFiles\Sites\murally\VirtualDirectory0\site\wwwroot\static\views\browser-not-supported.html', stackTrace=Error: EROFS, stat 'C:\DWASFiles\Sites\murally\VirtualDirectory0\site\wwwroot\static\views\browser-not-supported.html'
url=/version, err=EROFS, stat '\\10.207.210.135\volume-24-default\2f3d1379c05cbce7972b\8494b376ec4f4bd6bc7c28a383a50d25\site\wwwroot\static\version', stackTrace=Error: EROFS, stat '\\10.207.210.135\volume-24-default\2f3d1379c05cbce7972b\8494b376ec4f4bd6bc7c28a383a50d25\site\wwwroot\static\version'
url=/version, err=EROFS, stat '\\10.207.210.135\volume-24-default\2f3d1379c05cbce7972b\8494b376ec4f4bd6bc7c28a383a50d25\site\wwwroot\static\version', stackTrace=Error: EROFS, stat '\\10.207.210.135\volume-24-default\2f3d1379c05cbce7972b\8494b376ec4f4bd6bc7c28a383a50d25\site\wwwroot\static\version'
url=/version, err=EROFS, stat '\\10.207.210.135\volume-24-default\2f3d1379c05cbce7972b\8494b376ec4f4bd6bc7c28a383a50d25\site\wwwroot\static\version', stackTrace=Erro
var util = require('util'),
crypto = require('crypto');
function getSharedSignature(bucket, path) {
var now = new Date().getTime();
var expires = Math.round((now + 10 * 365 * 24 * 3600 * 1000) / 1000); // Ten years
var cannonicalPath = util.format("/%s/%s", bucket, path);
var stringToSign = util.format("GET\n\n\n%s\n%s", expires, cannonicalPath);
var signature = crypto.createHmac("sha1", process.env.AWS_ACCESS_SECRET).update(stringToSign).digest("base64");

Hi elarraona,

For enhanced security all our murals are now private, if you want to share it with anyone (without requiring her to sign-up or login) you can use the view link :

  • Click on the Share Menu

  • Select Share, and copy view link