Skip to content

Instantly share code, notes, and snippets.

View buurzx's full-sized avatar
🎯
Focusing

Pavel Romanov buurzx

🎯
Focusing
  • Earth
View GitHub Profile
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
@buurzx
buurzx / phone_verification_delivery_service.rb
Created April 18, 2016 07:57
PhoneVerificationDeliveryService
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
class Account::PhoneVerificationService
attr_reader :account, :errors
MAX_FAILED_ATTEMPTS = 3
def initialize(account)
@account = account
end
def verify(code)
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
@buurzx
buurzx / service_client.rb
Last active May 7, 2016 18:52
Name of service is changed to Service =)
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 = {
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)
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 {} \;
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
@buurzx
buurzx / site.conf
Created May 30, 2017 20:47 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on https://terrty.net/2014/ssl-tls-in-nginx/
# 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
@buurzx
buurzx / deploy.rb
Created June 20, 2017 20:02 — forked from noma4i/deploy.rb
Deploy Phoenix Elixir by mina
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"