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
| namespace :web do | |
| desc "Custom task to disable web" | |
| task :disable, :roles => :web, :except => {:no_release => true} do | |
| require 'erb' | |
| on_rollback {run "rm #{shared_path}/system/maintenance.html"} | |
| template = File.read(File.join(File.dirname(__FILE__), "deploy", "templates", "maintenance.html.erb")) | |
| result = ERB.new(template).result(binding) | |
| put result, "#{shared_path}/system/maintenance.html", :mode => 0644 | |
| end | |
| end |
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
| def save_profile | |
| unless params[:user].blank? | |
| if params[:user][:uploaded_picture].blank? | |
| params[:user].delete(:uploaded_picture) | |
| end | |
| end | |
| u = current_user | |
| err_msg = nil | |
| begin |
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
| module Sass::Script | |
| module Functions | |
| # substitue text in a string | |
| # @params | |
| # str the string to substitute text from | |
| # reg the regexp given to sub | |
| # rep the replacement text | |
| def sub(str, reg, rep = '') | |
| Sass::Script::String.new(str.to_s.sub(/#{reg.to_s}/, rep.to_s)) | |
| end |
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
| <VirtualHost *:80> | |
| ServerName cootweet_p.local | |
| DocumentRoot "/Users/joe/work/cootweet/public" | |
| RailsEnv production | |
| RailsAllowModRewrite off | |
| ExpiresActive on | |
| <directory "/Users/joe/work/cootweet/public"> | |
| Options -Indexes |
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
| #user nobody; | |
| worker_processes 1; | |
| #error_log logs/error.log; | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; | |
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; | |
| server_name localhost; | |
| root /home/kafka/apps/cootweet/public; # <--- be sure to point to 'public'! | |
| passenger_enabled on; | |
| location ~* \.(ico|css|js|gif|jp?g|png)(\?[0-9]+)?$ { | |
| expires max; | |
| break; | |
| } |
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
| ExpiresActive on | |
| <FilesMatch "\.(js|css|gif|png|jpg)$"> | |
| ExpiresDefault "access plus 2 year" | |
| </FilesMatch> |
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
| gzip on; | |
| gzip_http_version 1.0; | |
| gzip_comp_level 2; | |
| gzip_proxied any; | |
| gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; |
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
| <directory "/Users/joe/work/cootweet/public"> | |
| Options -Indexes | |
| Order allow,deny | |
| Allow from all | |
| AddOutputFilterbyType DEFLATE text/plain text/html text/css application/javascript text/xml application/xml application/xml+rss text/javascript | |
| </directory> |
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
| curl --head http://cootweet_p.local/images/camera.png?1246970549 |
OlderNewer