Skip to content

Instantly share code, notes, and snippets.

View kiote's full-sized avatar
👋

Ёkaterina Krivich kiote

👋
View GitHub Profile
class MyClass
def do_somth_with_class(class)
class.send(method.to_sym)
other_stuff
end
end
class Formatter
def output_report(title, text)
raise 'Abstract method called'
end
end
class HtmlFormatter < Formatter
def output_report(title, text)
<<-EOF
<html>
class Generator
def initialize(reporter, title, text)
@reporter = reporter
@title = title
@text = text
end
def make_report
@reporter.output_report(title, text)
end
formatter = HtmlFormatter.new
g = Generator.new(formatter, 'title', 'my long and interesting text')
g.make_report
formatter = PdfFormatter.new
g = Generator.new(formatter, 'title', 'my long and interesting text')
g.make_report
/// было
$select = $table->select()
->where('parent_id = ?', $this->_post->getId())
->order('time');
$repliesXml = '';
foreach ($select->fetchAll() as $item) {
$repliesXml .= $item->getFullXml();
}
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
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;
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
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