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
'use strict'; | |
var fs = require('fs'); | |
exports.action = { | |
name: 'stream', | |
description: 'send a stream file to a client', | |
outputExample: {}, | |
matchExtensionMimeType: false, | |
version: 1.0, |
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 nodemailer = require('nodemailer'); | |
module.exports = { | |
initialize: function(api, next){ | |
api.email = { | |
transporter: nodemailer.createTransport('smtps://user%40gmail.com:[email protected]'), | |
send: function(to, subject, body, callback){ | |
var payload = { | |
from: '"Fred Foo 👥" <[email protected]>', |
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
'use strict'; | |
exports.action = { | |
name: 'session-delete', | |
description: 'session-delete', | |
blockedConnectionTypes: [], | |
outputExample: {}, | |
matchExtensionMimeType: false, | |
version: 1.0, | |
toDocument: true, |
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 phidgets = require('phidgets').phidgets; | |
var pivotal = require("pivotal"); | |
// curl -d username=$USERNAME -d password=$PASSWORD -X POST https://www.pivotaltracker.com/services/v3/tokens/active | |
var apiToken = "XXXXXXXXXXXXXXXXXXX"; | |
var projectID = 12345; | |
var OwnedBy = "Evan Tahler"; | |
var checkTimerMS = 500; | |
var newer_than_version = 0; | |
var PhidgetHost = "phidgetsbc.local"; |
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
set :application, "MY_APPLICATION" | |
set :repository, "[email protected]:PATH_TO_MY_REPO" | |
set :scm, :git | |
set :use_sudo, false | |
set :keep_releases, 5 | |
set :deploy_via, :remote_cache | |
set :main_js, "MAIN_APP.js" | |
desc "Setup the Demo Env" | |
task :demo do |
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
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { | |
for (id key in userInfo) { | |
NSLog(@"key: %@, value: %@", key, [userInfo objectForKey:key]); | |
if ([key isEqualToString:@"aps"]){ | |
self.LastPushMessageMessage = [[userInfo objectForKey:key] objectForKey:@"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
api.socketServer.gracefulShutdown = function(api, next, alreadyShutdown){ | |
if(alreadyShutdown == null){alreadyShutdown = false;} | |
if(alreadyShutdown == false){ | |
api.socketServer.server.close(); | |
alreadyShutdown = true; | |
} | |
for(var i in api.socketServer.connections){ | |
var connection = api.socketServer.connections[i]; | |
if (connection.responsesWaitingCount == 0){ | |
api.socketServer.connections[i].end("Server going down NOW\r\nBye!\r\n"); |
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 reloadAWorker = function(next){ | |
var count = 0; | |
for (var i in cluster.workers){ count++; } | |
if(workersExpected > count){ | |
startAWorker(); | |
} | |
if(workerRestartArray.length > 0){ | |
var worker = workerRestartArray.pop(); | |
worker.send("stop"); | |
} |
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
#!/usr/bin/env node | |
// load in the actionHero class | |
var actionHero = require(__dirname + "/../api.js").actionHero; // normally if installed by npm: var actionHero = require("actionHero").actionHero; | |
var cluster = require('cluster'); | |
// if there is no config.js file in the application's root, then actionHero will load in a collection of default params. You can overwrite them with params.configChanges | |
var params = {}; | |
params.configChanges = {}; |
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
#!/usr/bin/env node | |
////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// | |
// TO START IN CONSOLE: `./scripts/actionHeroCluster` | |
// TO DAMEONIZE: `forever start scripts/actionHeroCluster` | |
// | |
// ** Producton-ready actionHero cluster example ** | |
// - workers which die will be restarted | |
// - maser/manager specific logging |