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
from boto.sqs.jsonmessage import JSONMessage | |
MESSAGE_BODY_TEMPLATE = { | |
'article_id': int, | |
'owner_id': int, | |
'auth_token': str | |
} | |
NUMBER_OF_MESSAGES = 10 | |
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
module.exports = function (socket, handleError, config) { | |
// set some common items we will need from config | |
var route = config.route; | |
var model = config.model; | |
// define the socket behavior | |
socket.on(route, function (data) { | |
switch (data.action) { |
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
module.exports = function (socket, config) { | |
var route = config.route; | |
var errorHandler = function (errRoute, err) { | |
var data = { | |
socket: errRoute, | |
error: err | |
}; | |
socket.emit(route, data); |
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
factory('ErrorHelper', function() { | |
return { | |
errorMessage: "", | |
dismissError: function () { | |
this.errorMessage = ""; | |
}, | |
logToConsole: function (data) { | |
console.log("ERROR:"); | |
console.log(data); | |
} |
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
module.exports = function (socket, handleError, config) { | |
// set some common items we will need from config | |
var route = config.route; | |
var model = config.model; | |
socket.on(route, function (data) { | |
switch (data.action) { |
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 hat = require('hat'); | |
module.exports = function (socket, handleError, config) { | |
// set some common items we will need from config | |
var route = config.route; | |
var userModel = config.model; | |
socket.on(route, function (data) { |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "precise32" | |
config.vm.provision :shell, :path => "bootstrap.sh" | |
config.vm.box_url = "http://files.vagrantup.com/precise32.box" |
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
# Get the Node ARM package | |
wget http://nodejs.org/dist/v0.10.9/node-v0.10.9-linux-arm-pi.tar.gz | |
# Extract it | |
tar xvzf node-v0.10.9-linux-arm-pi.tar.gz | |
# Copy files to a permanent spot | |
sudo cp -r node-v0.10.9-linux-arm-pi/* /opt/node | |
# Add it to your PATH |
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 mySpecialMessage = "Suck It!"; | |
var sendMySpecialMessage = function () { | |
var textareasOnPage = document.getElementsByTagName("textarea"); | |
for (var i = 0; i < textareasOnPage.length; ++i) { | |
var item = textareasOnPage[i]; | |
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
module.exports = function ( socket, handleError, config ) { | |
var route = config.route; | |
var model = config.model; | |
var query = config.query; | |
var sort = config.sort; | |
var interval = config.interval; | |
setInterval( function () { |
OlderNewer