This file contains hidden or 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 'underscore' | |
| child_process = require 'child_process' | |
| async = require 'async' | |
| healthCheckInterval = 60 * 1000 | |
| bounceInterval = 60 * 1000 | |
| bounceWait = bounceInterval + 30 * 1000 | |
| delayTimeout = (ms, func) -> setTimeout func, ms | |
| class MonitoredChild |
This file contains hidden or 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, "SampleApp" | |
| set :repository, "." | |
| set :scm, :none | |
| set :use_sudo, false | |
| set :keep_releases, 5 | |
| #Use the copy method which will compress and scp the files | |
| set :deploy_via, :copy | |
| set :main_js, "app.js" |
This file contains hidden or 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'; | |
| (function() { | |
| var mod = angular.module("App.services", []); | |
| //register other services here... | |
| /* pubsub - based on https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js*/ | |
| mod.factory('pubsub', function() { | |
| var cache = {}; |
This file contains hidden or 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
| server { | |
| listen 80; # listen on http (port 80) | |
| server_name blog.example.com; # the domain name people will access your site at | |
| root /home/deployer/docs; # path to deploy to, eg: "/home/#{user}/docs". this should match whatever was in your Capistrano deploy file. | |
| expires 1d; # how long should static files be cached for, see http://nginx.org/en/docs/http/ngx_http_headers_module.html for options. | |
| } |
This file contains hidden or 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
| --- | |
| en: | |
| greetings: | |
| hello: | |
| world: Hello World! | |
| friend: Hello Friend! | |
| user: Hello %{user} | |
| inbox: | |
| messages: | |
| one: You have one message in your inbox. |
This file contains hidden or 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
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |
This file contains hidden or 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
| #!/bin/env node | |
| // OpenShift sample Node application | |
| var winston = require('winston'); | |
| var MongoDB = require('winston-mongodb').MongoDB; | |
| winston.add(MongoDB, { | |
| db: process.env.OPENSHIFT_APP_NAME | |
| , host: process.env.OPENSHIFT_NOSQL_DB_HOST | |
| , port: parseInt(process.env.OPENSHIFT_NOSQL_DB_PORT, 10) |
This file contains hidden or 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
| upstream lb-subprint { | |
| ip_hash; | |
| server 192.241.180.249:3222 weight=10 max_fails=3 fail_timeout=30s; # Reverse proxy to machine-1 | |
| server 192.241.241.152:3222 weight=10 max_fails=3 fail_timeout=30s; # Reverse proxy to machine-2 | |
| } | |
| server { | |
| listen 80; | |
| server_name www.subprint.com subprint.com; |
This file contains hidden or 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
| /* | |
| * base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers | |
| * | |
| * (C) 2010, Nodejitsu Inc. | |
| * | |
| */ | |
| var base64 = exports; | |
| base64.encode = function (unencoded) { |
This file contains hidden or 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
| // https://github.com/ciberch/activity-streams-mongoose | |
| Activity.find().sort('published', 'descending').limit(10).run( | |
| function (err, docs) { | |
| var activities = []; | |
| if (!err && docs) { | |
| activities = docs; | |
| res.render('index', {activities: activities}); | |
| } | |
| }); |