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
(defn- queue-stuck? | |
[events] | |
(comment "простейшая проверка, что очередь не стала меньше")) | |
(defn- make-alert-event | |
[events] | |
(merge (first events) { :state "major" :description (str "Смотрите как все плохо " events)})) | |
(defn- when-stuck | |
[children] |
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
WITH table_scans as ( | |
SELECT relid, | |
tables.idx_scan + tables.seq_scan as all_scans, | |
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, | |
pg_relation_size(relid) as table_size | |
FROM pg_stat_user_tables as tables | |
), | |
all_writes as ( | |
SELECT sum(writes) as total_writes | |
FROM table_scans |
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 NewMsisdnInUseError < Error; | |
def initialize(msg, models:) | |
super msg | |
@models = models | |
end | |
def inspect | |
Object.instance_method(:inspect).bind(self).call | |
end | |
end |
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
set -g default-command "exec /bin/zsh -l" | |
set -g bell-action none | |
set -g history-limit 10000 | |
set -g base-index 1 | |
set -g default-terminal "screen-256color" | |
#setw -u automatic-rename |
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
module ReverseField | |
def field=(value) | |
value = value.reverse | |
super | |
end | |
end | |
class C | |
include ReverseField |
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 Name < AcriveRecord::Base | |
# includes & extensions | |
include Module | |
# constants | |
CONST = 1 | |
# attributes | |
attr_accessor :attribute |
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
gem 'pg' | |
gem 'jquery-rails' | |
gem "haml-rails" | |
gem 'simple_form' | |
gem "rabl", git: "git://github.com/nesquena/rabl.git" | |
gem "unicorn" | |
gem 'state_machine' | |
gem 'haml-rails' | |
gem_group :development do |
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
# Index | |
--------------------------------------------------------------------- | |
curl -XPUT http://localhost:9200/pictures/ -d ' | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"index_analyzer": { | |
"tokenizer": "standard", |
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
Configus.build Rails.env do | |
env :production do | |
services do | |
stripe "StripeService" | |
stripe_gateway "StripeGateway" | |
end | |
end |
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 ::Chef::Provider::HttpRequest < Chef::Provider | |
def load_current_resource | |
Chef::Log.debug("load_current_resource: #{@new_resource.inspect}") | |
@rest = Chef::REST.new(@new_resource.url, nil, nil, :disable_gzip => true) | |
end | |
end |
NewerOlder