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
require 'net/ssh' | |
require "#{File.dirname(__FILE__)}/utils/gems.rb" | |
require "#{File.dirname(__FILE__)}/utils/multi_logger.rb" | |
require "#{File.dirname(__FILE__)}/utils/subprocess.rb" | |
class SpecHelper | |
class << self | |
@@booted = false |
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 sendAbandonedCartEmail = function(api, cart, callback){ | |
api.models.find({where: {id: cart.user_id}}).then(function(error, user){ // api.models are loaded via sequelize | |
if(error){ return next(error); ) | |
if(!user){ return next(new Error('user not found')); ) | |
api.cartHelper.sendAbandonmentEmail(api, user, callback); // api.cartHelper would be dinfined in an initializer | |
}).catch(callback); | |
}; |
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
exports.default = { | |
mongo: function(api){ | |
return { | |
enable: true, | |
host: '1.2.3.4' | |
port: 27017 | |
db: 'myDatabase' | |
} | |
} | |
} |
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
config.mySQL = { | |
"database" : "v3_development", | |
"dialect" : "mysql", | |
"port" : 3306, | |
"pool" : { | |
"maxConnections" : 20, | |
"maxIdleTime" : 30000 | |
}, | |
"replication" : { | |
"write": { |
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
//////////////////////////////////////////////////////////////////////////// | |
// Sessions | |
module.exports = { | |
initialize: function(api, next){ | |
api.session = { | |
prefix: "__session", | |
sessionExipreTime: 1000 * 60 * 60 // 1 hour |
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 fs = require('fs'); | |
var maxLogFileSize = '100000'; | |
exports.task = { | |
name: 'cleanLogFiles', | |
description: 'I will clean (delete) all log files if they get to big', | |
frequency: 60 * 60 * 1000, | |
queue: 'default', | |
plugins: [], | |
pluginOptions: {}, |
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
exports.task = { | |
name: 'pingSocketClients', | |
description: 'I will send a message to all connected socket clients. This will help with TCP keep-alive and send the current server time. Note that this will only ping the clients of one server, and will not work in cluster', | |
frequency: 5 * 1000, | |
queue: 'default', | |
plugins: [], | |
pluginOptions: {}, | |
run: function(api, params, next){ | |
for(var i in api.connections.connections){ |
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
exports.task = { | |
name: 'sayHi', | |
description: 'I will log to the console every so often', | |
frequency: 5 * 1000, | |
queue: 'default', | |
plugins: [], | |
pluginOptions: {}, | |
run: function(api, params, next){ | |
api.log("Hello!", "alert"); |
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 path = require('path'); | |
var config = require(__dirname + '/config/sequelize'); | |
var env = 'default'; | |
if(config[process.env.NODE_ENV]){ env = process.env.NODE_ENV; } | |
config = config[env].sequelize(); | |
config.config = __filename; | |
config['migrations-path'] = path.resolve('db', 'sequelize', 'migrate'); |
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
<!-- Basic Font Stuff --> | |
<em>words</em> | |
<strong>words</strong> | |
<u>underlined!</u> | |
<p>I am paragraph 1</p> | |
<p>I am paragraph 2</p> | |
<!-- headings --> |