Skip to content

Instantly share code, notes, and snippets.

View mPanasiewicz's full-sized avatar

Maciej Panasiewicz mPanasiewicz

View GitHub Profile
class AddRequestFieldToCasheNames < ActiveRecord::Migration
class CacheName < ActiveRecord::Base
end
def change
add_column :cache_names, :request, :text
CacheName.find_each do |cache_name|
cache_name.request = '{"method":"get_config","type":"kom","channel":"direct","sign":"587d6320f50666918c40c4bf125164b8","transform_ver":"' + cache_name.transform_ver + '","pkb_content_ver":"A1"}'
cache_name.save
end
puts "Please enter cost"
cost = gets.chomp.to_f
puts "Please enter money"
money = gets.chomp.to_f
rest = money - cost
while rest < 0
puts "You still owe %.2f" % rest
tw,te,f,o,q,d,n,p = 0,0,0,0,0,0,0,0
puts "Please enter cost"
cost = gets.chomp.to_f
puts "Please enter money"
money = gets.chomp.to_f
rest = money - cost
if rest < 0
puts "You still owe %.2f" % rest
tw = te = f = o = q = d = n = p = 0,0,0,0,0,0,0,0
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.008 000.008: --- VIM STARTING ---
000.093 000.085: Allocated generic buffers
000.725 000.632: locale set
000.761 000.036: GUI prepared
Plugin 'gmarik/vundle'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-bundler'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-commentary'
Plugin 'tpope/vim-speeddating'
Plugin 'vim-ruby/vim-ruby'
if !empty(matchstr($MY_RUBY_HOME, 'jruby'))
let g:ruby_path = join(split(glob($MY_RUBY_HOME.'/lib/ruby/*.*')."\n".glob($MY_RUBY_HOME.'/lib/rubysite_ruby/*'),"\n"),',')
endif
let(:my_handler) { MyClassInitialization.new(some params) }
subject { my_handler.call }
shared_examples_for 'returns proper error message' do
expect(subject.status).to be_falsey
expect(subject.code).to equal(204)
expect(subject.payload).not_to be_empty
end
context 'invalid data' do
require 'rails_helper'
RSpec.describe Spree::Admin::ProductsController, type: :controller do
describe 'GET synchronize' do
stub_authorization!
let!(:variant) { create(:variant) }
it 'updates @products pkb starpacks details' do
spree_get :synchronize, id: variant
expect(response).to have_http_status(200)
validates :full_name, format: { with: /\A([-']?[a-ząęóżźćńłśA-ZŁŻ]){2,30} +([-']?[a-ząęóżźćńłśA-ZŁŻ]){2,30}\z/,
message: Spree.t('wrong_format') }
validates :email, format: { with: /\A\S+@\S+\.\S+\z/, message: Spree.t('wrong_format') }
Sneakers.configure(
heartbeat: 2,
exchange: 'sneakers',
exchange_type: :direct,
durable: true,
workers: Rails.application.secrets.sneakers_processes,
threads: Rails.application.secrets.sneakers_threads,
prefetch: Rails.application.secrets.sneakers_threads, # this is not a typo: the doc says it's good to match prefetch and threads values
timeout_job_after: 60,
share_threads: true, # both options are supported by `after_hook` hereafter