Skip to content

Instantly share code, notes, and snippets.

@siraz-provectus
siraz-provectus / gist:2cd761568c0d6bc1fdee91ff84307088
Last active August 20, 2020 11:22
Тестовое задане
Написать Апи для мобильного приложения.
Пользователь регистрация/аутентификация
Добавление событиий в свой календарь (title, description, start_time, end_time, status)
После того как событие пройдет, статус должен меняться на завершенное
Пользователь может получить все свои события (фильтры произвольные)
Пользователь может редактировать событие, но только не завершенные
@siraz-provectus
siraz-provectus / send file
Last active January 26, 2018 17:12
users-export
excel_builder = Exports::UserExcelExport.new(sm_response.profiles)
file_name = "users.xls"
headers['Content-Type'] = "text/xls"
headers['Content-disposition'] = "attachment; filename=\"#{file_name}\""
headers['X-Accel-Buffering'] = 'no'
headers['Cache-Control'] ||= 'no-cache'
headers.delete('Content-Length')
response.status = 200
self.response_body = excel_builder.build
require 'formula'
class Imagemagick < Formula
homepage 'http://www.imagemagick.org'
url 'http://www.imagemagick.org/download/releases/ImageMagick-6.9.5-10.tar.xz'
sha256 '2805ab7945ca92251172335da992df800bcc09fee993eeb4711b20c53efeb233'
head 'https://www.imagemagick.org/subversion/ImageMagick/trunk',
:using => UnsafeSubversionDownloadStrategy
workers Integer(ENV['WEB_CONCURRENCY'] || 8)
threads_count = Integer(ENV['MAX_THREADS'] || 8)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 5000
environment ENV['RACK_ENV'] || 'production'
puts 'Enter sequence'
mass = String(gets.chomp)
mass = mass.split(//);
count = 1
exit_mass = []
b = ''
mass.each_with_index do |a, index|
if index > 0
if b == a
count +=1
@siraz-provectus
siraz-provectus / gist:b11de7fd1a31b752f98a
Created June 19, 2014 06:02
after change password via ajax current_user log out
http://stackoverflow.com/questions/8230855/rails-devise-ajax-call