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
// Requires the Toast plugin: https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin | |
// And Ionic Framework: http://ionicframework.com | |
// ngCordova is used here, but easily removed: http://ngcordova.com/ | |
// When running in Cordova, show the native toast. Outside of Cordova, show an Ionic Popup for the same period of time. | |
// Uses the API for the Toast plugin - message, duration, position. | |
// Differences are that: Ionic Popup ignores position, and doesn't allow doing anything while it shows. | |
.factory('Toast', function($rootScope, $timeout, $ionicPopup, $cordovaToast) { | |
return { | |
show: function (message, duration, position) { |
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
upstream app { | |
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name www.app.com; | |
rewrite ^/(.*) http://app.com/$1 permanent; | |
} | |
server { |
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
# My pimped out unicorn config, with incremental killof | |
# and all the latest capistrano & bundler-proofing | |
# @jamiew :: http://github.com/jamiew | |
application = "000000book.com" | |
environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production' | |
app_path = "/srv/#{application}" | |
bundle_path = "#{app_path}/shared/bundle" | |
timeout 30 |
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
# unicorn_rails -c /srv/myapp/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
working_directory (rails_env == 'production' ? "/srv/myapp/current" : `pwd`.gsub("\n", "")) | |
worker_processes (rails_env == 'production' ? 10 : 4) | |
preload_app true | |
timeout 30 | |
if rails_env == 'production' |