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
| resources :campaigns, only: [:index, :update] do | |
| resources :banners | |
| resources :phrases do | |
| member do | |
| get 'statistics' | |
| end | |
| end | |
| 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
| #!/bin/bash | |
| source ~/.bash_profile | |
| cd /var/lib/jenkins/jobs/SEOTracker/workspace/ | |
| rvm 1.9.3 | |
| bundle install --without development test | |
| RAILS_ENV=staging rspec spec |
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 'domain.ru', :app, :web, :db, :primary => true | |
| set :deploy_to, "/home/www/domain" | |
| set :rails_env, "staging" | |
| set :user, "apps" | |
| set :unicorn_conf, "#{deploy_to}/current/config/unicorn_staging.rb" | |
| set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid" | |
| set :shared_path, "#{deploy_to}/shared" |
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 :deploy do | |
| task :restart do | |
| run "if [ -f #{unicorn_pid} ]; then kill -USR2 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && bundle exec unicorn_rails -c #{unicorn_conf} -E #{rails_env} -D; fi" | |
| end | |
| task :start do | |
| run "bundle exec unicorn_rails -c #{unicorn_conf} -E #{rails_env} -D" | |
| end | |
| task :stop do |
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 :stages, %w(production staging) | |
| set :default_stage, "staging" | |
| require 'capistrano/ext/multistage' | |
| set :application, "application_name" | |
| set :repository, "git@your_path_to_git.git" | |
| set :scm, :git | |
| set :keep_releases, 5 |
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
| deploy_to = "/home/www/domain" | |
| rails_root = "#{deploy_to}/current" | |
| pid_file = "#{deploy_to}/shared/pids/unicorn.pid" | |
| log_file = "#{rails_root}/log/unicorn.log" | |
| err_log = "#{rails_root}/log/unicorn_error.log" | |
| old_pid = pid_file + '.oldbin' | |
| listen "/home/www/domain/tmp/sockets/unicorn.sock", :backlog => 64 | |
| timeout 30 |
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 domain { | |
| server unix:/home/www/domain/tmp/sockets/unicorn.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80; | |
| server_name domain.ru www.domain.ru; | |
| access_log /var/log/domain.ru/nginx-access.log; | |
| error_log /var/log/domain.ru/nginx-error.log; | |
| client_max_body_size 1G; |
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
| apps@vs1191219:/srv/www$ sudo apt-get upgrade | |
| Reading package lists... Done | |
| Building dependency tree | |
| Reading state information... Done | |
| You might want to run 'apt-get -f install' to correct these. | |
| The following packages have unmet dependencies: | |
| libc-dev-bin : Depends: libc6 (> 2.13) but 2.11.2-10 is installed | |
| libc6 : Depends: libc-bin (= 2.11.2-10) but 2.13-21 is installed | |
| libc6-dev : Depends: libc-dev-bin (= 2.11.2-10) but 2.13-21 is installed | |
| libstdc++6-4.4-dev : Depends: libc6-dev (>= 2.13-5) but 2.11.2-10 is installed |
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
| /// было | |
| $select = $table->select() | |
| ->where('parent_id = ?', $this->_post->getId()) | |
| ->order('time'); | |
| $repliesXml = ''; | |
| foreach ($select->fetchAll() as $item) { | |
| $repliesXml .= $item->getFullXml(); | |
| } |
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
| formatter = PdfFormatter.new | |
| g = Generator.new(formatter, 'title', 'my long and interesting text') | |
| g.make_report |