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
SellableGood.where(name: 'iPhone 5s With FaceTime Gold 16GB 4G LTE').each do |product| | |
image = product.sellable_good_images.first | |
image.url_remote_url = 'http://ipic.su/img/img7/fs/iphone.1549538811.jpg' | |
image.save | |
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
require 'telegram/bot' | |
require 'net/http' | |
require 'nokogiri' | |
token = 'блах' | |
last_message_text = 'https://www.upwork.com/jobs/Deploy-Ruby-Rails-app-VPS_%7E011db7752412caefe9?source=rss' | |
100500.times do | |
uri = URI('https://www.upwork.com/find-work-home/rss?securityToken=6f8fb3697e4e8bbbf6e67c9fc0d46985e7a45a64fadb71642916ef53e6620f9c~4818447') | |
xml_str = Net::HTTP.get_response(uri) |
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 after_payment | |
p = params | |
booking = Booking.find(params[:orderId]) | |
generated_hash = Digest::MD5.hexdigest([Setting.find_by_name('rbkmoney').value, p['orderID'], "Бронирование номера #{booking.room.name}", | |
Setting.find_by_name('rbkmoneyAccount').value, booking.price, "RUR", p['status'], '', booking.email, p['paymentData'], | |
Setting.find_by_name('secretKey').value].join('::')) | |
if p['hash'] == generated_hash | |
if p['status'] == 5 | |
booking.update_attribute(:state, "paid") | |
BookingMailer.paid(booking.id).deliver |
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
.row | |
.col-xs-12.col-sm-6.col-md-6.col-lg-6 | |
= form_tag do | |
.row | |
.col-xs-9.col-md-5 | |
= select_tag :field, options_for_select([["test", 1], ["test", 1]]), class: "form-control" | |
.col-md-3 | |
= submit_tag "Nuevo +", class: "btn btn-primary" | |
.col-md-2.col-lg-2 | |
.col-xs-12.col-sm-6.col-md-3.col-lg-3 |
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
.row | |
.col-xs-12.col-sm-6.col-md-6.col-lg-6 | |
= form_tag do | |
.row | |
.col-xs-9.col-md-5 | |
= select_tag :field, options_for_select([["test", 1], ["test", 1]]), class: "form-control" | |
.col-md-3 | |
= submit_tag "Nuevo +", class: "btn btn-primary" | |
.col-md-2.col-lg-2 | |
.col-xs-12.col-sm-6.col-md-3.col-lg-3 |
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
var blockid = 0; | |
$(document).on('click', '.js-add-room', function (ev) { | |
// ev.preventDefault(); | |
if ($('.js-step-room-input').filter(function() { return $(this).val() == ""; }).length > 0) { | |
return; | |
} | |
blockid++; | |
var block = $(this).parents('.js-room-fields'), | |
name = block.find('.js-name').val(); | |
if (name == '') { |
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
- @license_agreements_term.each do |lat| | |
- @term_acceptance = TermAcceptance.where(license_agreement_term_id: lat.id) | |
- unless params["from-#{lat.id}"].blank? | |
- @term_acceptance = @term_acceptance.where('DATE(created_at) >= ?', params["from-#{lat.id}"]) | |
- unless params["to-#{lat.id}"].blank? | |
- @term_acceptance = @term_acceptance.where('DATE(created_at) <= ?', params["to-#{lat.id}"]) | |
.well | |
.row | |
.col-md-7 | |
h4 Text |
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
level1 = StationeryCategory.find_by_title(spreadsheet.row(i)[1]) | |
level2 = StationeryCategory.find_by_title(spreadsheet.row(i)[2]) | |
level3 = StationeryCategory.find_by_title(spreadsheet.row(i)[3]) | |
if spreadsheet.row(i)[1].nil? | |
level1 = StationeryCategory.create(title: "Other") if level1.nil? and StationeryCategory.find_by_title("Other").nil? | |
else | |
level1 = StationeryCategory.create(title: spreadsheet.row(i)[1]) if level1.nil? | |
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
#<StringIO:0xa346cf0> | |
(0.6ms) BEGIN | |
SQL (0.8ms) INSERT INTO `hotels` (`accept_cards`, `address`, `created_at`, `description`, `metro_station_id`, `name`, `phone`, `seo_description`, `seo_keywords`, `seo_title`, `status`, `updated_at`, `url`, `wifi`) VALUES (1, 'м. ВДНХ, ул. Ярославская, д.15, к. 3 ', '2014-09-15 08:04:01', '<p>К услугам жителей и гостей столицы предоставлены 330 номеров различных категорий гостиницы «ВашОтель – Золотой колос». Условия проживания комфортны и доступны благодаря сравнительно невысокой стоимости проживания. Здесь есть все необходимые условия: холодильник, ТВ, телефон. Гостеприимный персонал «Золотого колоса» поможет вам при решении любой проблемы, связанной с организацией комфортного проживания.</p>\n<p>Гостиница «Золотой колос» подтвердила свой статус среди других отелей – она стала обладателем премии «Золотая ладья» уже 4 раза.</p>\n<p>В комплексе из шести жилых корпусов есть все для организации приятного времяпрепровождения: тренажерный зал, кафе, кондитерская со свеж |
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
require "./lib/exchange_rates" | |
rates = ExchangeRates.new | |
data = {czk: rates.get_value_by_char_code('CZK'), usd: rates.get_value_by_char_code('USD'), eur: rates.get_value_by_char_code('EUR')} if rates.ok? | |
every 3.hours do | |
runner "Exchange.find_by_name('CZK').update_attribute(:rate, data[:czk])" | |
runner "Exchange.find_by_name('USD').update_attribute(:rate, data[:usd])" | |
runner "Exchange.find_by_name('RUB').update_attribute(:rate, data[:eur])" | |
end |
NewerOlder