Skip to content

Instantly share code, notes, and snippets.

View sashich's full-sized avatar
💣

Alexander sashich

💣
View GitHub Profile
s3_headers: {
'Content-Type' => 'application/gzip',
'Content-Encoding' => 'gzip'
}

Keybase proof

I hereby claim:

  • I am sashich on github.
  • I am sashich (https://keybase.io/sashich) on keybase.
  • I have a public key ASB_0nwWXXQjuC_oIzAjCoEnwYzr0DIYUugzp0Q5yiLKngo

To claim this, I am signing this object:

Добрый день, ⚡️☄️💥

Запрос мульти-виджета (Batch)

Несколко виджетов можно забрать один запросом. Результат запроса будет закэшиован. Подроднее про Widgets Api читайте в докумнетации.

Пример вызова для двух товаров (curl):

@sashich
sashich / ruby_jd.md
Created October 12, 2018 09:43
Описание вакансии Ruby разработчик (middle)

Вакансия: Ruby разработчик (middle)

От компаниии Shopplot.

В Shoppilot мы разрабатываем SaaS сервис для управления пользовательским контентом (UGC). Команда небольшая, а клиенты — главным образом крупные и средние интернет-магазины.

В продуктовую команду требуется Ruby разработчик.

В работе используем стеки технологий: Ruby, Rails 5, Mongo DB, Elasticsearch, Redis, Lua, OpenResty, AngularJS, CoffeeScript

@sashich
sashich / Dockerfile
Last active August 29, 2015 14:13 — forked from shingara/Dockerfile
## Docker file of shingara/chruby container
FROM base
MAINTAINER Cyril Mougel "cyril.mougel@gmail.com"
RUN apt-get update
RUN apt-get install -q -y wget
RUN apt-get install -q -y ca-certificates
RUN apt-get install -q -y make

Yesterday I upgraded our running elasticsearch cluster on a site which serves a few million search requests a day, with zero downtime. I've been asked to describe the process, hence this blogpost.

To make it more complicated, the cluster was running elasticsearch version 0.17.8 (released 6 Oct 2011) and I upgraded it to the latest 0.19.10. There have been 21 releases between those two versions, with a lot of functional changes, so I needed to be ready to roll back if necessary.

Our setup:

  • elasticsearch

We run elasticsearch on two biggish boxes: 16 cores plus 32GB of RAM. All indices have 1 replica, so all data is stored on both boxes (about 45GB of data). The primary data for our main indices is also stored in our database. We have a few other indices whose data is stored only in elasticsearch, but are updated once daily only. Finally, we store our sessions in elasticsearch, but active sessions are cached in memcached.

@sashich
sashich / gist:5668782
Created May 29, 2013 08:27
Basic auth for upstream
auth_basic "development";
# An arbitrary name for the authentication realm;
auth_basic_user_file /etc/nginx/.htpasswd;
# Path to an Apache htpasswd file;
proxy_set_header Authorization "";
gem 'guard'
gem 'guard-shell'
bundle exec guard --watchdir #{GUARD_WATCH_DIR} --guardfile #{GUARD_CONFIG_FILE}
guard :shell do
SOURCE = "/var/records/source"
DESTINATION = "/var/records/dest"
watch %r{^(.*)\.wav$} do |m|
`lame -b 32 --resample 8 -a #{SOURCE}/#{m[1]}.wav #{DESTINATION}/#{m[1]}.mp3`
end
ignore %r{^in-(.*)\.wav$}, %r{^out-(.*)\.wav$}
end