Skip to content

Instantly share code, notes, and snippets.

View BadAllOff's full-sized avatar
I'm open to new opportunities

BadAllOff BadAllOff

I'm open to new opportunities
View GitHub Profile
@BadAllOff
BadAllOff / Guardfile
Created August 28, 2016 16:21 — forked from palkan/Guardfile
Guardfile for Rails
# По умолчанию запускаем только необходимых для тестов наблюдателей,
# то есть всех, кроме server.
# Для запуска всех: bundle exec guard -g default
scope groups: ['specs']
group 'specs' do
# запускаем тесты и использованием Spring
guard :rspec, cmd: "bundle exec spring rspec" do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)
@BadAllOff
BadAllOff / rails_admin.ru.yml
Created October 23, 2016 17:40 — forked from serghost/rails_admin.ru.yml
RU translation for the gem 'rails_admin' (перевод гема rails_admin)
# 02.03.2016 Перевод gem rails_admin ~> 0.8
# Не забудьте добавить переводы названия модели (в т.ч. мн. ч.) и - опционально - атрибутов.
# Некоторые переводы, где нужны склонения, видоизменены, тем не менее, имхо,
# это не повлияло на удобство интерфейса
ru:
admin:
js:
true: 'True'
false: 'False'
@BadAllOff
BadAllOff / postgresql_configuration_on_ubuntu_for_rails.md
Created October 31, 2016 22:03 — forked from p1nox/postgresql_configuration_on_ubuntu_for_rails.md
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@BadAllOff
BadAllOff / gist:3761d906d8cbd3adbce2c7fe86b4de9c
Created November 10, 2016 08:57 — forked from kinopyo/gist:2224867
Check whether a Paperclip attachment exists

Check whether a Paperclip attachment exists

Don’t simply test for the presence of the magic Paperclip attribute, it will return a paperclip Attachment object and thus always be true:

- if user.photo.present? # always true
  = image_tag(user.photo.url)
@BadAllOff
BadAllOff / devise.ru.yml
Created December 2, 2016 10:27 — forked from k1r8r0wn/devise.ru.yml
Devise russian
# Русский перевод для https://github.com/plataformatec/devise/tree/v3.5.6
# Другие переводы на http://github.com/plataformatec/devise/wiki/I18n
ru:
devise:
confirmations:
confirmed: "Ваша учётная запись успешно подтверждена."
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
send_paranoid_instructions: "Если ваш адрес email есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
failure:
@BadAllOff
BadAllOff / gist:06bbce913365363829e577c50d7980f0
Created June 18, 2017 09:29 — forked from WizardOfOgz/gist:1012107
Save Base64-encoded images with Paperclip
class Avatar < ActiveRecord::Base
attr_accessor :content_type, :original_filename, :image_data
before_save :decode_base64_image
has_attached_file :image,
PAPERCLIP_CONFIG.merge(
:styles => {
:thumb => '32x32#',
:medium => '64x64#',
@BadAllOff
BadAllOff / SOLID.markdown
Created November 21, 2017 16:19 — forked from emaraschio/SOLID.markdown
SOLID Principles with ruby examples

#SOLID Principles with ruby examples

##SRP - Single responsibility principle A class should have only a single responsibility.

Every class should have a single responsibility, and that responsibility should be entirely encapsulated. All its services should be narrowly aligned with that responsibility, this embrace the high cohesion.

##OCP - Open/closed principle Software entities should be open for extension, but closed for modification.

@BadAllOff
BadAllOff / rails_new_help_output.md
Created December 16, 2017 23:58 — forked from eliotsykes/rails_new_help_output.md
"rails new" options explained

Run rails new --help to view all of the options you can pass to rails new:

$ bin/rails new --help
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
@BadAllOff
BadAllOff / gist:25c0c45fa4930eb760107b15320fccb1
Created December 19, 2017 23:07 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@BadAllOff
BadAllOff / gist:2e7add0e2ced2071e965ea729dc04e60
Created December 25, 2017 20:57 — forked from evtuhovich/gist:1134998
Список вопросов для собеседования
Ruby
принципиальное различие скриптовых и “обычных” языков
3 принципа ООП
реализация множественного наследования в ruby
duck typing
многопоточность в ruby
Rails
что такое MVC и зачем это нужно
локига в контроллере, должна ли быть и почему
синхронные и асинхронные операции — предложить варианты решения