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
h4 | |
= fa_icon('arrow-circle-o-down', text: 'Получатель') | |
.form-group | |
// юридическое лицо | |
label.radio-inline | |
= radio_button_tag :'order[recipient_attributes][individual]', '0', false, :'ng-model' => 'order.recipient.individual', :'ng-click'=> 'choose_recipient_in_address =false' | |
| Юридическое лицо | |
// физическое лицо | |
label.radio-inline |
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 Account::PhoneVerificationDeliveryService | |
PHONE_NUMBER = Rails.application.secrets.twilio['phone_number'] if Rails.application.secrets.twilio | |
attr_reader :account, :errors | |
def initialize(account) | |
@account = account | |
@errors = [] | |
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
class Account::PhoneVerificationService | |
attr_reader :account, :errors | |
MAX_FAILED_ATTEMPTS = 3 | |
def initialize(account) | |
@account = account | |
end | |
def verify(code) |
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 'spec_helper' | |
describe Account::PhoneVerificationService do | |
let(:verification_code) { SecureRandom.hex(5) } | |
let!(:account) { create(:account, phone_verification_code: verification_code, phone_verification_sent_at: 2.hours.ago) } | |
let(:service) { Account::PhoneVerificationService.new(account) } | |
describe '#verify' do | |
describe 'with valid code' do | |
it 'should be success' 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
module ServiceClient | |
class ArgumentError < ::ArgumentError; end | |
class ServiceClientError < StandardError; end | |
class ServiceServerError < ServiceClientError; end | |
class Base | |
require 'httparty' | |
BASE_URL = Rails.application.secrets.service['url'] | |
HEADERS = { |
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 'service_client' | |
class Result < OpenStruct | |
attr_reader :response, :parsed_body | |
def initialize(response) | |
@response = response | |
@parsed_body = JSON.parse(response.body) | |
super(parsed_body) if parsed_body.is_a?(Hash) |
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
To change all the directories to 755 (drwxr-xr-x): | |
find /opt/lampp/htdocs -type d -exec chmod 755 {} \; | |
To change all the files to 644 (-rw-r--r--): | |
find /opt/lampp/htdocs -type f -exec chmod 644 {} \; |
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
It's a set of scripts he created for that workflow. | |
But to answer your question: | |
$ git checkout -b myFeature dev | |
Creates MyFeature branch off dev. Do your work and then | |
$ git commit -am "Your message" | |
Now merge your changes to dev without a fast-forward |
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
# read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
# your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
# $ nginx -c /etc/nginx/nginx.conf -t | |
server { | |
# public key, contains your public key and class 1 certificate, to create: | |
# (example for startssl) | |
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
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 'mina/bundler' | |
require 'mina/git' | |
require 'mina/rbenv' | |
set :domain, 'your_domain.com' | |
set :deploy_to, '/home/deployer/app_name' | |
set :repository, 'git@github.com:user_name/app_name' | |
set :branch, ENV["brunch"] || 'master' | |
set :app_name, "app_name" |
OlderNewer