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 async = require('async'); | |
var r = require('rethinkdb'); | |
var debug = require('debug')('rethinkdb'); | |
// first get some warming data to insert | |
var warmMessages = require('./generate-messages.js')(10000); | |
var host = process.env.HOST || 'localhost'; | |
// get real data to insert |
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 async = require('async'); | |
var r = require('rethinkdbdash')(); | |
var debug = require('debug')('rethinkdb'); | |
// first get some warming data to insert | |
var warmMessages = require('./generate-messages.js')(10000); | |
var host = process.env.HOST || 'localhost'; | |
// get real data to insert |
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 async = require('async'); | |
var MongoClient = require('mongodb').MongoClient; | |
var debug = require('debug')('mongodb'); | |
// first get some warming data to insert | |
var warmMessages = require('./generate-messages.js')(10000); | |
// get real data to insert | |
var messages = require('./generate-messages.js')(process.env.NB_MESSAGES); | |
var writes = require('./result')('mongodb_writes'); |
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
package main | |
import "code.google.com/p/go-tour/tree" | |
import "fmt" | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
func Walk(t *tree.Tree, ch chan int) { | |
if t.Left != nil { | |
Walk(t.Left, ch) |
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
// This module will load ./process.env.APP_ENV.json and exports it | |
// And will also read args from command line and merge them, i.e.: | |
// node index.js --server.hostname=192.168.56.1 | |
// will work. | |
// Usually this module should be in ./config/index.js | |
// And then you use var config = require('./config'); | |
// You must set an APP_ENV | |
if (!process.env.APP_ENV) { |
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 removePrivateProperties(dirty) { | |
return Object.keys(dirty).reduce(function(clean, keyName) { | |
if (keyName.indexOf('_') === 0) { | |
return clean; | |
} | |
var value = dirty[keyName]; | |
if (typeof value === 'object' && Object.keys(value).length > 0) { | |
value = removePrivateProperties(value); |
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 test = require('tape'); | |
var jade = require('jade'); | |
test('it should keep whitespace between tags if any', function(t) { | |
t.plan(1); | |
var fn = jade.compile('input\ninput'); | |
t.equal(fn(), '<input/> <input/>'); | |
}); |
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 AlgoliaSearch = require('algolia-search'); | |
var client = new AlgoliaSearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'); | |
var index = client.initIndex('contacts'); | |
index.search('a', function() { | |
console.log(arguments); | |
}); |
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
// hello world | |
var algoliasearch = require('algoliasearch'); | |
var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76', {protocol: 'http:'}); | |
var query = 'ab'; | |
client.startQueriesBatch(); | |
client.addQueryInBatch( | |
'contacts', // index name | |
query, { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<h1>Title</h1> | |
<script src="/bundle.js"></script> | |
</body> |
OlderNewer