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
# This query deletes all users which have been created through woocommerce sign up form | |
DELETE from wp_users where wp_users.ID not in ( | |
SELECT meta_value FROM wp_postmeta WHERE meta_key = '%_customer_user' | |
) AND wp_users.ID not in (select distinct(post_author) from wp_posts); | |
# This query deletes all woocommerce orders | |
# [IMPORTANT] QUERY ORDER MATTERS [IMPORTANT] | |
DELETE FROM wp_woocommerce_order_itemmeta; | |
DELETE FROM wp_woocommerce_order_items; | |
DELETE FROM wp_commentmeta WHERE meta_id IN ( SELECT comment_id FROM wp_comments WHERE comment_type = 'order_note' ); |
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
stream { | |
upstream stream_backend { | |
server 'rabbitmq-1:5672' max_fails=2 fail_timeout=30s; # rabbitmq-1 private address in my network | |
server 'rabbitmq-2:5672' max_fails=2 fail_timeout=30s; # rabbitmq-2 private address in my network | |
server 'rabbitmq-3:5672' max_fails=2 fail_timeout=30s; # rabbitmq-3 private address in my network | |
} | |
log_format proxy '$remote_addr [$time_local] ' | |
'$protocol $status $bytes_sent $bytes_received ' | |
'$session_time "$upstream_addr" ' | |
'"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"'; |
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
class TwitterWelcomeMessageService | |
def self.call(*args) | |
new(*args).call | |
end | |
private | |
def call(twitter_handle) | |
client.update("@#{twitter_handle} welcome to 'Oranges & Apples', we hope you enjoy our juicy fruit!") | |
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
Mieliście już szkolenie z #RODO w swoich firmach? To tu klasyka, krążąca ostatnio po sieci (pierwotny autor nieznany): | |
- Dzień dobry! - słyszę w słuchawce. | |
- Dzień dobry, w czym mogę pomóc? | |
- Wczoraj wieczorem przechodząc koło pana biura zrobiłem kupę – rzecze mężczyzna. | |
- Co? - pytam nie będąc pewien, czy dobrze zrozumiałem. | |
- Na trawniku, po lewej stronie od wejścia. Postawiłem takiego średniej wielkości balasa – wyjaśnia mój rozmówca spokojnym cierpliwym głosem. | |
Z telefonem przy uchu wychodzę z biura i patrzę na trawnik. Rzeczywiście dwa metry od wejścia do mojego biura leży brązowy balas. Obok niego kawałek brudnej serwetki. Rozglądam się wokół w obawie czy to nie jakaś prowokacja. Ludzie przechodzą jednak obojętnie i nikt nie patrzy w moim kierunku. | |
- Bardzo brzydko się pan zachował – oceniam mojego rozmówcę. - Dzwoni pan, żeby przeprosić, czy może zapytać kiedy może pan posprzątać? - dopytuję. |
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
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 |
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
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') } |
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 '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) |
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
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 |
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
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 |
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
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' |
NewerOlder