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
CarrierWave.configure do |config| | |
if Rails.env.development? || Rails.env.test? | |
config.storage = :file | |
else | |
config.storage = :fog | |
config.fog_credentials = { | |
:provider => 'OpenStack', | |
:openstack_auth_url => 'https://auth.selcdn.ru/v1.0', | |
:openstack_username => Rails.application.secrets.openstack_username, | |
:openstack_api_key => Rails.application.secrets.openstack_api_key |
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 'resolv' | |
require 'dry/types' | |
require 'dry/validation' | |
require 'pp' | |
module MyTypes | |
include Dry.Types() | |
REGEX256 = Resolv::IPv4::Regex256 | |
REGEXP = { |
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 'dry-types' | |
require 'dry-validation' | |
module Types | |
include Dry::Types.module | |
end | |
ctx = Dry::Validation.Schema do | |
required(:some_int).filled(Types::Strict::Int) | |
required(:some_bool).filled(Types::Strict::Bool) |
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 'test_helper' | |
class NoisyString | |
def coerce(value, options = {}) | |
value.to_s.upcase | |
end | |
end | |
class User | |
include ShallowAttributes |
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
bugagazavr@Kirills-Mac-Pro ~/Documents/Ruby/teobit_fog (master●●)$ bundle exec rake assets:precompile | |
MiniTest::Unit::TestCase is now Minitest::Test. From /Users/bugagazavr/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit/testcase.rb:8:in `<module:Unit>' | |
[fog][WARNING] PATCHING Fog::Storage::OpenStack to added debugging information to JSON decoding | |
cp public/assets/chosen-sprite-d097caf71641f3afb04998af85b36b33.png public/assets/chosen-sprite.png | |
cp public/assets/chosen-sprite-fa9df9bbee9f1ab89799379cb153636e.png public/assets/chosen-sprite.png | |
cp public/assets/chosen-sprite@2x-5975a8658625306b2570c7c4146f8595.png public/assets/chosen-sprite@2x.png | |
cp public/assets/chosen-sprite@2x-f574a81d811e99d629b5b35cbfee5dae.png public/assets/chosen-sprite@2x.png | |
[fog][WARNING] Unrecognized arguments: region | |
[/awesome] empty? true parse_json: true type: | |
[/awesome] content-type: '' |
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
bugagazavr@Kirills-Mac-Pro ~/Documents/Ruby/teobit_fog (master●●)$ bundle exec rake assets:precompile | |
MiniTest::Unit::TestCase is now Minitest::Test. From /Users/bugagazavr/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit/testcase.rb:8:in `<module:Unit>' | |
[fog][WARNING] PATCHING Fog::Storage::OpenStack to added debugging information to JSON decoding | |
cp public/assets/chosen-sprite-d097caf71641f3afb04998af85b36b33.png public/assets/chosen-sprite.png | |
cp public/assets/chosen-sprite-fa9df9bbee9f1ab89799379cb153636e.png public/assets/chosen-sprite.png | |
cp public/assets/chosen-sprite@2x-5975a8658625306b2570c7c4146f8595.png public/assets/chosen-sprite@2x.png | |
cp public/assets/chosen-sprite@2x-f574a81d811e99d629b5b35cbfee5dae.png public/assets/chosen-sprite@2x.png | |
[fog][WARNING] Unrecognized arguments: region | |
[/awesome] empty? true parse_json: true type: | |
rake aborted! |
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
bugagazavr@kirill-pc ~/Ruby/teobit (master●●●●)$ rails c [ruby-2.1.0] | |
MiniTest::Unit::TestCase is now Minitest::Test. From /home/bugagazavr/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/test/unit/testcase.rb:8:in `<module:Unit>' | |
Loading development environment (Rails 4.1.0.beta1) | |
2.1.0 :001 > h = {:body=>"[{\"hash\": \"ce57f8c0298ccef30834b4211c2cce05\", \"last_modified\": \"2014-01-15T19:06:25.171580\", \"bytes\": 326251, \"name\": \"assets/portfolio/yakimanka/big-b98fe3cc2755fd1e4a555df5daf29501.png\", \"content_type\": \"image/png\"}, {\"hash\": \"ceda121d33a60bd23c13d76684eb0703\", \"last_modified\": \"2014-01-15T19:06:25.405910\", \"bytes\": 21918, \"name\": \"assets/portfolio/yakimanka/graphics/attendance-cad26723da5b872a5dfd6c0787f0ee65.png\", \"content_type\": \"image/png\"}, {\"hash\": \"02e4b3bf43a5a07267ca23e4304f4b9f\", \"last_modified\": \"2014-01-15T19:06:25.697320\", \"bytes\": 11058, \"name\": \"assets/portf |
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
source 'http://rubygems.org' | |
source 'https://rails-assets.org' | |
gem 'rails', '4.1.0.beta1' | |
gem 'pg', '~> 0.17.1' | |
gem 'devise', '~> 3.2.2' | |
gem 'yaml_db', github: 'Teobit/yaml_db' | |
gem 'nokogiri', '1.6.0' | |
gem 'carrierwave', '~> 0.9.0' |
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
excon.request {:chunk_size=>1048576, :ciphers=>"HIGH:!SSLv2:!aNULL:!eNULL:!3DES", :connect_timeout=>60, :debug_request=>false, :debug_response=>true, :headers=>{"User-Agent"=>"fog/1.19.0", "X-Auth-Key"=>"SOMEKEY", "X-Auth-User"=>"SOMEUSER", "Host"=>"auth.selcdn.ru:443"}, :idempotent=>false, :instrumentor_name=>"excon", :middlewares=>[Excon::Middleware::ResponseParser, Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock], :mock=>false, :nonblock=>true, :omit_default_port=>false, :persistent=>false, :read_timeout=>60, :retry_limit=>4, :ssl_verify_peer=>true, :tcp_nodelay=>false, :uri_parser=>URI, :write_timeout=>60, :host=>"auth.selcdn.ru", :path=>"/v1.0", :port=>443, :query=>nil, :scheme=>"https", :user=>nil, :password=>"REDACTED", :instrumentor=>Excon::StandardInstrumentor, :expects=>[200, 204], :method=>"GET", :retries_remaining=>4, :connection=>#<Excon::Connection:7f976f534450 @data={:chunk_size=>1048576, :ciphers=>"HIGH:!SSLv2:!aNULL:!eNULL:! |
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 'http' | |
require 'colored' | |
require 'nokogiri' | |
$url = 'http://playo.ru/goods/241/#.Ur8zaWRdVmg' | |
$run = '/Applications/VLC.app/Contents/MacOS/VLC /Users/bugagazavr/Downloads/1.mp3' | |
$start_price = 695 | |
def get | |
res = HTTP.get($url).response |
NewerOlder