This file contains hidden or 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
| # encoding: utf-8 | |
| require 'mechanize' | |
| require 'stringex' | |
| require 'tempfile' | |
| require Rails.root.join('app/models/category') | |
| require Rails.root.join('app/models/product') | |
| class Parser | |
| BASE_URL = "http://asiaopt.com" | |
| URL_MASK = "#{BASE_URL}/products/page:%s" |
This file contains hidden or 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
| definitions | |
| definition1 | |
| definition2 | |
| definition3 | |
| synonymes | |
| synonym1 | |
| definition1 | |
| definition2 | |
| definition3 | |
| synonym2 |
This file contains hidden or 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
| ######################################################################################### | |
| # Manage websites | |
| class Dashboard::WebsitesController < ApplicationController | |
| before_action :find_website, only: %w(show edit update destroy) | |
| def index | |
| @websites = current_user.websites | |
| end |
This file contains hidden or 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
| ssh er -t 'pg_dump -h localhost -U estrabota estrabota_production | gzip > /tmp/estrabota.gz' | |
| scp er:/tmp/estrabota.gz ./tmp | |
| psql -U postgres -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'estrabota_development';" | |
| psql -U postgres -c "DROP DATABASE estrabota_development;" | |
| psql -U postgres -c "CREATE DATABASE estrabota_development WITH TEMPLATE = template0 ENCODING = 'UNICODE' OWNER estrabota;" | |
| gunzip -c ./tmp/estrabota.gz | psql -U postgres estrabota_development |
This file contains hidden or 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
| config.action_mailer.raise_delivery_errors = true | |
| config.action_mailer.default_url_options = { :host => 'example.ru' } | |
| config.action_mailer.delivery_method = :smtp | |
| config.action_mailer.smtp_settings = { | |
| :address => "smtp.yandex.ru", | |
| :port => 587, | |
| :domain => 'example.ru', | |
| :user_name => 'info@example.ru', | |
| :password => 'passwd', | |
| :authentication => 'plain' |
This file contains hidden or 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
| { | |
| count: function() { | |
| return function (text, render) { | |
| return counter++ | |
| } | |
| }, | |
| hasDefinitions: function() { return this.definitions.length > 0 }, | |
| expandFirst: function() { | |
| return counter == 1 | |
| }, |
This file contains hidden or 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 RandomORG | |
| FORMAT = :plain | |
| BASE = 10 | |
| RND = :new | |
| COL = 1 | |
| MIN = 1 | |
| DIGITS = :on | |
| LOWERALPHA = :on | |
| UPPERALPHA = :on | |
| UNIQUE = :on |
This file contains hidden or 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
| grammar Interpolation | |
| rule document | |
| (text / variable / object / space)* { | |
| def content | |
| elements.map { |e| e.content } | |
| end | |
| } | |
| end | |
| ###################################################################### |
This file contains hidden or 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
| # encoding: utf-8 | |
| require 'valid_email' | |
| class Vacancy < ActiveRecord::Base | |
| include Workflow | |
| # Сколько рубрик разрешено иметь | |
| RUBRICS = 1..3 | |
| # Разрешенные периоды публикации |
This file contains hidden or 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 @ColumnResizer | |
| doc : null | |
| columnsWrapper : null | |
| dragging : false | |
| currentGutter : null | |
| snapped : | |
| x1: 0, | |
| x2: 0 | |
| gutterWidth : 20 | |
| spanWidth : 60 |