This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Tests run on Ubuntu Server 12.04 LTS x86-64 | |
*/ | |
/*****************************************************************************/ | |
/* DISK */ | |
/*****************************************************************************/ | |
/* 15 GB File Random IO */ | |
#sysbench --test=fileio --file-total-size=15G prepare |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_gmail(email, callback) { | |
var email_host_regex = /.*@(.+)$/; | |
var gmail_servers_regex = /(\.google\.com|\.googlemail\.com)$/i; | |
var m = email_host_regex.exec(email); | |
if(m && m.length > 1) { | |
var host = m[1] && m[1].toLowerCase(); | |
if(host == "gmail.com") { | |
return callback(null, true); | |
} else { | |
dns.resolveMx(host, function(err, result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<script type="text/template" id="nirror-chat-template"> | |
<div class="nirror-box" data-bind="visible: visible"> | |
<div class="nirror-bubble" data-bind="visible: bubbleVisible"> | |
<span data-bind="text: infoMessage"></span> | |
<span style="float: right; cursor: pointer;" data-bind="click: closeBubble">x</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.nirror-box { | |
position: fixed; | |
text-align: left; | |
bottom: 0; | |
width: 300px; | |
padding: 0; | |
background-color: #ffffff; | |
box-shadow: rgba(0,0,0,0.5) 0 2px 6px; | |
z-index: 10000; | |
font-family: arial, sans-serif !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.io=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | |
module.exports = _dereq_('./lib/'); | |
},{"./lib/":2}],2:[function(_dereq_,module,exports){ | |
/** | |
* Module dependencies. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongodb = require('mongodb') | |
, Db = mongodb.Db | |
, Server = mongodb.Server | |
, ReplSetServers = mongodb.ReplSetServers; | |
var mode = process.argv.slice(2)[0] || 'server'; | |
var mongoConfig = { | |
replset : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongodb = require('mongodb') | |
, Db = mongodb.Db | |
, Server = mongodb.Server | |
, ReplSetServers = mongodb.ReplSetServers; | |
var mode = process.argv.slice(2)[0] || 'server'; | |
var mongoConfig = { | |
replset : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var File = new mongoose.Schema({ | |
servername : { type: String, index: { unique: true } } | |
, originalname : String | |
}); | |
var FileModel = mongoose.model('File', File); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var mongoConfig = { | |
servers : [ | |
'localhost:27017/test-replset' | |
, 'localhost:27018' | |
, 'localhost:27019' | |
] | |
, options : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function openFile(db, filename, callback) { | |
var gs = new mongodb.GridStore(db, filename, "r"); | |
gs.open(function(err, gs) { | |
if(err) { | |
callback(err, gs); | |
return; | |
} | |
callback(null, gs); |
OlderNewer