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
def AES_encrypt(password) | |
if not_encrypted? | |
AES_crypt(password) { |c| c.encrypt } | |
encrypt! | |
end | |
end | |
def AES_decrypt(password) | |
if encrypted? | |
AES_crypt(password) { |c| c.decrypt } |
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
class DecryptJob < Struct.new(:bundle_id, :password) | |
def perform | |
bundle = Bundle.find(bundle_id) | |
begin | |
bundle.start_process! | |
bundle.decrypt_slots(password) | |
bundle.finish_process | |
bundle.remove_slot_afted_download = true | |
bundle.save | |
rescue OpenSSL::Cipher::CipherError |
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
# TYPE DATABASE USER ADDRESS METHOD | |
# "local" is for Unix domain socket connections only | |
local all all md5 | |
# IPv4 local connections: | |
host all all 127.0.0.1/32 md5 | |
# IPv6 local connections: | |
host all all ::1/128 md5 | |
# Allow replication connections from localhost, by a user with the | |
# replication privilege. |
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: bucardo | |
# Required-Start: $remote_fs $syslog postgresql-9.3 | |
# Should-Start: postgresql-9.3 | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Manage bucardo | |
# Description: Start, stop, restart bucardo |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'cql' | |
require 'base32' | |
require 'simple_uuid' | |
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) | |
# http://www.elasticsearch.org/blog/changing-mapping-with-zero-downtime/ |
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
Старайтесь добавлять только уникальные изображения, и не пользоваться общедоступными баннерами и картинками с первых страниц Google.Картинки или Яндекс. Изображения, такие изображения могут повторяться и со временем терять свою привлекательность. | |
Добавляйте изображение большего размера, чем нужно, и лучше квадратной формы, меньшее будет увеличено и тем самым искажено, такие изображения редко получают высокий CTR. | |
Не используйте много восклицательных знаков, так как это может отпугнуть человека, лучше использовать заголовки в форме общения: вопрос - ответ, как правило такие заголовки чаще привлекают к себе внимание. | |
Составляя рекламный текст, привлекайте фантазию, а не банально копируйте технические характеристики. (Пример: плохо - Телевизор черный; хорошо - Можно смотреть, а можно видеть!) В конце заголовка не ставится точка, в случае необходимости можно поставить троеточие, вопросительный или восклицательный знак. | |
Все обращения на "Вы" (купите, посмотрите и т.д.) | |
Некоторые рекомендации по составлению рекламн |
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
company = params['source'] == 'system' ? 'system' : params['company'] | |
domain = params['source'] == 'system' ? 'system' : params['domain'] | |
date_from = Time.parse(params['date_from']) | |
date_to = Time.parse(params['date_to']) | |
page = !params['page'].nil? ? params['page'].to_i : 1 | |
filtering_criteria = [] | |
filtering_criteria.push([:term, { controller: params['source'] }]) unless params['source'] == 'system' | |
filtering_criteria.push([:term, { domain: domain}]) unless domain.blank? | |
filtering_criteria.push([:term, { company: company}]) unless company.blank? |
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
new_version = 2 | |
Tire.index "#{Settings::ElasticSearch.index}_v#{new_version}" do | |
delete | |
create :mappings => { | |
:Log => { | |
:properties => { | |
:id => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:object_id => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:company => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, | |
:domain => { type: 'string', index: "not_analyzed", norms: { enabled: false }, include_in_all: false }, |